# 使用基础镜像 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}"