From d1317acac077c1e783746caa97875071686e38bf Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 2 Jun 2024 15:32:01 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b90350a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +# 使用基础镜像 +FROM catthehacker/ubuntu:act-latest + +# 设置维护者信息 +LABEL maintainer="your-email@domain.com" + +# 更新Ubuntu的软件包,并安装maven需要的所有库 +RUN apt-get update + +# 安装 JDK 17 +RUN apt-get install -y openjdk-17-jdk + +# 设置Java环境变量 +ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64 +ENV PATH $JAVA_HOME/bin:$PATH + +ARG android=34 + +ENV ANDROID_HOME /opt/android-sdk-linux +ENV PATH $PATH:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator + +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + git \ + git-lfs \ + gnupg \ + openssl \ + unzip +RUN curl -s https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o /tmp/tools.zip && \ + unzip -q /tmp/tools.zip -d /tmp && \ + yes | /tmp/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true && \ + /tmp/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install "cmdline-tools;latest" && \ + rm -r /tmp/tools.zip /tmp/cmdline-tools && \ + mkdir -p /root/.android/ && touch /root/.android/repositories.cfg +RUN yes | sdkmanager --licenses >/dev/null || true && \ + sdkmanager --install \ + "platforms;android-${android}" \ + "platform-tools" + +ARG cmake=3.18.1 +ARG ndk=21.4.7075529 + +ENV NDK_ROOT "${ANDROID_HOME}/ndk/${ndk}" +RUN sdkmanager --install \ + "cmake;${cmake}" \ + "ndk;${ndk}"