diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7af2ce2 --- /dev/null +++ b/Dockerfile @@ -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