-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
83 lines (62 loc) · 3.88 KB
/
Dockerfile
File metadata and controls
83 lines (62 loc) · 3.88 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM ubuntu:latest
RUN cd /opt
RUN mkdir android-sdk-linux && cd android-sdk-linux/
RUN apt-get update -qq \
&& apt-get install -y openjdk-8-jdk \
&& apt-get install -y wget \
&& apt-get install -y expect \
&& apt-get install -y zip \
&& apt-get install -y unzip \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
#RUN unzip tools_r25.2.3-linux.zip -d /opt/android-sdk-linux
RUN unzip tools_r25.2.3-linux.zip -d /opt/android_sdk
RUN rm -rf tools_r25.2.3-linux.zip
#ENV ANDROID_HOME /opt/android-sdk-linux
ENV ANDROID_HOME /opt/android_sdk
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
RUN echo y | android update sdk --no-ui --all --filter platform-tools | grep 'package installed'
# SDKs
# Please keep these in descending order!
RUN echo y | android update sdk --no-ui --all --filter android-28 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter android-27 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter android-25 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter android-24 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter android-23 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter android-18 | grep 'package installed'
RUN echo y | android update sdk --no-ui --all --filter android-16 | grep 'package installed'
# OR you can install everything like this
# RUN echo y | android update sdk --no-ui | grep 'package installed'
# build tools
# Please keep these in descending order!
RUN echo y | android update sdk --no-ui --all --filter build-tools-28.0.3 | grep 'package installed'
RUN echo y | android update sdk --no-ui --all --filter build-tools-27.0.3 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-25.0.2 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-25.0.1 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-25.0.0 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-24.0.3 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-24.0.2 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-24.0.1 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-23.0.3 | grep 'package installed'
RUN echo y | android update sdk --no-ui --all --filter build-tools-23.0.2 | grep 'package installed'
#RUN echo y | android update sdk --no-ui --all --filter build-tools-23.0.1 | grep 'package installed'
RUN android list sdk --all
# Update SDK
# This is very important. Without this, your builds wouldn't run. Your image would aways get this error:
# You have not accepted the license agreements of the following SDK components:
# [Android SDK Build-Tools 24, Android SDK Platform 24]. Before building your project,
# you need to accept the license agreements and complete the installation of the missing
# components using the Android Studio SDK Manager. Alternatively, to learn how to transfer the license agreements
# from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
#So, we need to add the licenses here while it's still valid.
# The hashes are sha1s of the licence text, which I imagine will be periodically updated, so this code will
# only work for so long.
RUN mkdir "$ANDROID_HOME/licenses" || true
RUN echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
RUN echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
RUN apt-get clean
RUN chown -R 1000:1000 $ANDROID_HOME
VOLUME ["/opt/android_sdk"]
RUN mkdir -p /www
WORKDIR /www
ADD ./ /www