forked from jsonfry/android-sdk-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (26 loc) · 1.14 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
FROM openjdk:8-slim
MAINTAINER jsonfry "[email protected]"
# Install Java
RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y curl unzip \
&& apt-get clean
# Download And Extract Android SDK
WORKDIR /opt/android-sdk
RUN curl -o tools.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip \
&& unzip tools.zip \
&& rm -f tools.zip
# Android SDK Paths
ENV ANDROID_HOME /opt/android-sdk
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
RUN mkdir -p ${ANDROID_HOME}/licenses
RUN echo 24333f8a63b6825ea9c5514f83c2829b004d1fee > ${ANDROID_HOME}/licenses/android-sdk-license
# Android packages
ADD packages /opt/android-sdk/packages
RUN mkdir -p /root/.android && touch /root/.android/repositories.cfg
# RUN sdkmanager --package_file=packages
# Workaround https://issuetracker.google.com/issues/66465833
RUN while read -r package; do PACKAGES="${PACKAGES}${package} "; done < packages && sdkmanager ${PACKAGES}
# ADB Key - Be careful what you do with devices that trust the built in key
ADD adbkey /root/.android/adbkey
ADD adbkey.pub /root/.android/adbkey.pub