GPTfree api
commited on
Update Dockerfile
Browse files- Dockerfile +43 -23
Dockerfile
CHANGED
|
@@ -1,30 +1,50 @@
|
|
|
|
|
| 1 |
FROM openjdk:11-jdk-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
rm -rf /var/lib/apt/lists/*
|
| 5 |
-
|
| 6 |
-
ENV ANDROID_HOME=/sdk
|
| 7 |
-
ENV PATH="${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${PATH}"
|
| 8 |
-
|
| 9 |
-
RUN mkdir -p $ANDROID_HOME/cmdline-tools && \
|
| 10 |
-
cd $ANDROID_HOME/cmdline-tools && \
|
| 11 |
-
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -O sdk-tools.zip && \
|
| 12 |
-
unzip sdk-tools.zip && \
|
| 13 |
-
rm sdk-tools.zip && \
|
| 14 |
-
mkdir latest && \
|
| 15 |
-
mv cmdline-tools/* latest/
|
| 16 |
-
|
| 17 |
-
RUN yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses && \
|
| 18 |
-
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33" "build-tools;33.0.2"
|
| 19 |
-
|
| 20 |
WORKDIR /app
|
| 21 |
-
RUN git clone https://github.com/martykan/webTube.git
|
| 22 |
-
WORKDIR /app/webTube
|
| 23 |
-
|
| 24 |
-
# JitPackリポジトリを追加する設定
|
| 25 |
-
RUN sed -i '/repositories {/a \ maven { url "https://jitpack.io" }' app/build.gradle
|
| 26 |
-
RUN echo "sdk.dir=/sdk" > local.properties
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
RUN ./gradlew clean build --refresh-dependencies --stacktrace
|
| 29 |
|
| 30 |
CMD ["./gradlew", "run"]
|
|
|
|
| 1 |
+
# ベースイメージ
|
| 2 |
FROM openjdk:11-jdk-slim
|
| 3 |
|
| 4 |
+
# 作業ディレクトリ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# 必要なツールとAndroid SDKのセットアップ
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
wget \
|
| 10 |
+
unzip \
|
| 11 |
+
git \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# Android SDKのインストール
|
| 15 |
+
ENV ANDROID_SDK_ROOT /sdk
|
| 16 |
+
RUN mkdir -p /sdk && \
|
| 17 |
+
wget -q "https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip" -O cmdline-tools.zip && \
|
| 18 |
+
unzip cmdline-tools.zip -d /sdk && \
|
| 19 |
+
rm cmdline-tools.zip && \
|
| 20 |
+
mkdir -p /sdk/cmdline-tools/latest && \
|
| 21 |
+
mv /sdk/cmdline-tools/* /sdk/cmdline-tools/latest && \
|
| 22 |
+
yes | /sdk/cmdline-tools/latest/bin/sdkmanager --licenses && \
|
| 23 |
+
/sdk/cmdline-tools/latest/bin/sdkmanager \
|
| 24 |
+
"platform-tools" \
|
| 25 |
+
"platforms;android-33" \
|
| 26 |
+
"build-tools;33.0.2"
|
| 27 |
+
|
| 28 |
+
# 環境変数
|
| 29 |
+
ENV PATH $PATH:/sdk/platform-tools:/sdk/build-tools/33.0.2
|
| 30 |
+
|
| 31 |
+
# Gradleのインストール
|
| 32 |
+
RUN wget -q "https://services.gradle.org/distributions/gradle-7.6-bin.zip" -O gradle.zip && \
|
| 33 |
+
unzip gradle.zip -d /opt/ && \
|
| 34 |
+
rm gradle.zip
|
| 35 |
+
ENV PATH $PATH:/opt/gradle-7.6/bin
|
| 36 |
+
|
| 37 |
+
# プロジェクトをコピー
|
| 38 |
+
COPY . /app
|
| 39 |
+
|
| 40 |
+
# NetCipherのクローンとビルド
|
| 41 |
+
RUN git clone https://github.com/guardianproject/NetCipher.git /netcipher && \
|
| 42 |
+
cd /netcipher && \
|
| 43 |
+
./gradlew build && \
|
| 44 |
+
mkdir -p /app/app/libs && \
|
| 45 |
+
cp /netcipher/netcipher/build/libs/netcipher.jar /app/app/libs/
|
| 46 |
+
|
| 47 |
+
# 必要な依存関係をインストールしてビルド
|
| 48 |
RUN ./gradlew clean build --refresh-dependencies --stacktrace
|
| 49 |
|
| 50 |
CMD ["./gradlew", "run"]
|