github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240516002902-d08759d6ca9f/pkg/builders/apk/Dockerfile (about) 1 FROM golang:bookworm 2 3 # Install native dependencies 4 RUN apt update 5 RUN apt install -y curl unzip default-jdk-headless make zip fdroidserver npm 6 7 # Install the Android SDK and NDK 8 ENV ANDROID_BUILD_TOOLS_VERSION='34.0.0' 9 ENV ANDROID_API_VERSION='34' 10 11 RUN curl -L -o '/tmp/commandlinetools.zip' 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip' 12 RUN rm -rf '/tmp/cmdline-tools' 13 RUN unzip -d '/tmp/' '/tmp/commandlinetools.zip' 14 15 RUN rm -rf '${HOME}/Android/Sdk' 16 RUN mkdir -p '${HOME}/Android/Sdk' 17 RUN yes | /tmp/cmdline-tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" 'cmdline-tools;latest' 'platform-tools' "platforms;android-${ANDROID_API_VERSION}" 'ndk-bundle' --sdk_root="${HOME}/Android/Sdk" 18 19 ENV HOME='/root' 20 ENV ANDROID_HOME="${HOME}/Android/Sdk" 21 ENV ANDROID_SDK_ROOT="${HOME}/Android/Sdk" 22 ENV ANDROID_NDK_ROOT="${HOME}/Android/Sdk/ndk-bundle" 23 ENV PATH="${PATH}:${ANDROID_HOME}/platform-tools" 24 25 # Install the legacy Android NDK 26 ENV ANDROID_LEGACY_API_VERSION='8' 27 ENV ANDROID_LEGACY_NDK_VERSION='16' 28 29 ENV ANDROID_LEGACY_HOME="${ANDROID_HOME}/ndk/android-ndk-r10e" 30 31 RUN curl -L -o '/tmp/sdk-legacy.zip' 'https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip' 32 RUN rm -rf "${ANDROID_LEGACY_HOME}" 33 RUN unzip -d "${ANDROID_HOME}/ndk" '/tmp/sdk-legacy.zip' 34 35 ENV ANDROID_NDK_VERSION='30' 36 37 RUN git config --global --add safe.directory '*' 38 39 COPY entrypoint.sh /entrypoint.sh 40 41 WORKDIR /hydrapp/work 42 43 CMD /entrypoint.sh