Skip to content

Instantly share code, notes, and snippets.

@augi
Created June 29, 2018 13:24
Show Gist options
  • Save augi/0bce9732a8bb7f04f7aa5ec76ff63e21 to your computer and use it in GitHub Desktop.
Save augi/0bce9732a8bb7f04f7aa5ec76ff63e21 to your computer and use it in GitHub Desktop.
Android build Dockerfile
FROM openjdk:8u111-jdk
ARG ANDROID_SDK_VERSION=24.4.1
ARG ANDROID_BUILD_TOOLS_VERSION=23.0.3
ARG ANDROID_API_LEVELS=android-23
ENV ANDROID_SDK_FILENAME android-sdk_r${ANDROID_SDK_VERSION}-linux.tgz
ENV ANDROID_SDK_URL http://dl.google.com/android/${ANDROID_SDK_FILENAME}
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS_VERSION}
# These dependencies are required by utilities from Android SDK. The cifs-utils is required for samples mounting.
RUN apt-get update && apt-get install -y lib32stdc++6 lib32z1 cifs-utils && rm -rf /var/lib/apt/lists/* && \
cd /opt && \
wget -q ${ANDROID_SDK_URL} && \
tar -xzf ${ANDROID_SDK_FILENAME} && \
rm ${ANDROID_SDK_FILENAME} && \
echo y | android update sdk --no-ui -a --filter tools,platform-tools,${ANDROID_API_LEVELS},build-tools-${ANDROID_BUILD_TOOLS_VERSION} --no-https
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment