Skip to content

Instantly share code, notes, and snippets.

@paramoshkinandrew
Created November 22, 2016 07:08
Show Gist options
  • Save paramoshkinandrew/6437d1d544828cd56aea24d90bfab9d3 to your computer and use it in GitHub Desktop.
Save paramoshkinandrew/6437d1d544828cd56aea24d90bfab9d3 to your computer and use it in GitHub Desktop.
Dockerfile for using in GitLab CI (or similar) to create Android builds. Includes Android SDK 24 and r13b Android NDK
FROM openjdk:8-jdk
MAINTAINER Andrew Paramoshkin <[email protected]>
ENV ANDROID_TARGET_SDK="24" \
ANDROID_BUILD_TOOLS="24.0.0" \
ANDROID_SDK_TOOLS="24.4.1" \
ANDROID_NDK_VERSION="13" \
PATH="$PWD/android-sdk-linux/tools:$PATH"
RUN apt-get --quiet update --yes
RUN apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
RUN wget --quiet --output-document=android-sdk.tgz https://dl.google.com/android/android-sdk_r${ANDROID_SDK_TOOLS}-linux.tgz && \
tar --extract --gzip --file=android-sdk.tgz
RUN mkdir "/android-sdk-linux/licenses" || true && \
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "/android-sdk-linux/licenses/android-sdk-license" && \
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "/android-sdk-linux/licenses/android-sdk-preview-license"
RUN echo y | android --silent update sdk --no-ui --all --filter android-${ANDROID_TARGET_SDK} && \
echo y | android --silent update sdk --no-ui --all --filter platform-tools && \
echo y | android --silent update sdk --no-ui --all --filter build-tools-#{ANDROID_BUILD_TOOLS}
RUN echo y | android --silent update sdk --no-ui --all --filter extra-android-m2repository && \
echo y | android --silent update sdk --no-ui --all --filter extra-google-google_play_services && \
echo y | android --silent update sdk --no-ui --all --filter extra-google-m2repository
RUN wget --quiet --output-document=android-ndk.zip https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_VERSION}b-linux-x86_64.zip && \
unzip android-ndk.zip
RUN rm android-sdk.tgz && rm android-ndk.zip
ENV "ANDROID_HOME" $PWD/android-sdk-linux
ENV "ANDROID_NDK_HOME" $PWD/android-ndk-r${ANDROID_NDK_VERSION}b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment