Skip to content

Commit

Permalink
Android + NDK + gcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicBakery authored Jan 13, 2019
1 parent 4f0a34b commit 700fb03
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ubuntu:18.04

ARG ANDROID_TARGET_SDK=28
ARG ANDROID_BUILD_TOOLS=28.0.3
ARG ANDROID_SDK_TOOLS=4333796
ARG ANDROID_NDK_TOOLS=r18b
ARG SONAR_CLI=3.3.0.1492

ENV ANDROID_HOME=${PWD}/android-sdk-linux
ENV ANDROID_NDK_HOME=${PWD}/android-ndk-${ANDROID_NDK_TOOLS}
ENV PATH=${PATH}:${ANDROID_HOME}/platform-tools
ENV PATH=${PATH}:${ANDROID_HOME}/tools
ENV PATH=${PATH}:${ANDROID_HOME}/tools/bin
ENV PATH=${PATH}:${ANDROID_NDK}
ENV PATH=${PATH}:/root/gcloud/google-cloud-sdk/bin

RUN apt-get update \
&& apt-get install wget gnupg openjdk-8-jdk unzip git curl python-pip bzip2 make --no-install-recommends -y \
&& rm -rf /var/cache/apt/archives \
&& update-ca-certificates \
&& pip install -U setuptools \
&& pip install -U wheel \
&& pip install -U crcmod \
# gcloud
&& curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install-dir=/root/gcloud --disable-prompts \
&& rm -rf /tmp/gcl \
# SDK
&& wget -q -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip \
&& mkdir ${ANDROID_HOME} \
&& unzip -qo android-sdk.zip -d ${ANDROID_HOME} \
&& chmod +x ${ANDROID_HOME}/tools/android \
&& rm android-sdk.zip \
# NDK
&& wget -q -O android-ndk.zip https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_TOOLS}-linux-x86_64.zip \
&& unzip -qo android-ndk.zip \
&& rm android-ndk.zip \
# Config
&& mkdir -p ~/.gradle \
&& echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties \
&& mkdir ~/.android \
&& touch ~/.android/repositories.cfg \
&& yes | sdkmanager --licenses > /dev/null \
&& sdkmanager --update > /dev/null \
&& sdkmanager "platforms;android-${ANDROID_TARGET_SDK}" "build-tools;${ANDROID_BUILD_TOOLS}" platform-tools tools > /dev/null

0 comments on commit 700fb03

Please sign in to comment.