-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (45 loc) · 2.06 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
45
46
47
48
49
50
51
52
53
FROM openjdk:8u181
RUN mkdir -p /android-sdk
# Install general dependencies
RUN dpkg --add-architecture i386 && apt-get update && apt-get install -yq \
apt-transport-https \
libncurses5:i386 \
libstdc++6:i386 \
software-properties-common \
zlib1g:i386 \
--no-install-recommends
# Setup ENV for android things
ENV ANDROID_HOME="/android-sdk"
ENV ANDROID_SDK="${ANDROID_HOME}"
ENV PATH="${ANDROID_SDK}/tools:${ANDROID_SDK}/platform-tools:${ANDROID_SDK}/tools/bin:${PATH}"
RUN echo "export PATH=${PATH}" > /root/.profile
# Downdload and install Android SDK (https://developer.android.com/studio/ Command Line Tools section)
ENV ANDROID_SDK_URL https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
RUN curl -L "${ANDROID_SDK_URL}" -o /tmp/android-sdk-linux.zip && \
unzip /tmp/android-sdk-linux.zip -d /tmp/ && \
rm /tmp/android-sdk-linux.zip && \
mv /tmp/tools ${ANDROID_HOME}/
ENV BUILD_TOOLS_VERSION 28.0.3
# Install Android SDK components
RUN yes | sdkmanager \
"platform-tools" \
"build-tools;${BUILD_TOOLS_VERSION}"
# Install images
RUN yes | sdkmanager --licenses && \
yes | sdkmanager \
"platforms;android-22" \
"system-images;android-22;google_apis;x86" \
"platforms;android-23" \
"system-images;android-23;google_apis;x86" \
"platforms;android-24" \
"system-images;android-24;google_apis;x86" \
"platforms;android-25" \
"system-images;android-25;google_apis;x86" \
"platforms;android-26" \
"system-images;android-26;google_apis;x86" \
"platforms;android-27" \
"system-images;android-27;google_apis;x86" \
"platforms;android-28" \
"system-images;android-28;google_apis;x86"
# Create emulators
RUN avdmanager create avd -n Nexus_5_x86 -k "system-images;android-22;google_apis;x86" --device "Nexus 5"