-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
44 lines (41 loc) · 1.8 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:18.04
ARG ANDROID_TARGET_SDK=30
ARG ANDROID_BUILD_TOOLS=29.0.3
ARG ANDROID_SDK_TOOLS=6858069
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}/cmdline-tools/bin
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/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip \
&& mkdir ${ANDROID_HOME} \
&& unzip -qo android-sdk.zip -d ${ANDROID_HOME} \
&& 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 --sdk_root=${ANDROID_HOME} --licenses > /dev/null \
&& sdkmanager --sdk_root=${ANDROID_HOME} --update > /dev/null \
&& sdkmanager --sdk_root=${ANDROID_HOME} "platforms;android-${ANDROID_TARGET_SDK}" "build-tools;${ANDROID_BUILD_TOOLS}" platform-tools tools > /dev/null