forked from Kusumoto/docker-ionic-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
59 lines (44 loc) · 1.68 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
54
55
56
57
58
59
FROM ubuntu:bionic
LABEL MAINTAINER="cagianx <[email protected]>"
ARG ANDROID_SDK_ROOT="/opt/android-sdk"
ENV ANDROID_SDK_ROOT "${ANDROID_SDK_ROOT}"
RUN apt-get update
RUN apt-get install -y \
build-essential \
openjdk-8-jre \
openjdk-8-jdk \
wget curl \
unzip \
zipalign \
zip \
git
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g @ionic/cli@^6.6 cordova@^9 @angular/cli@^9
# download and install Gradle
# https://services.gradle.org/distributions/
ARG GRADLE_VERSION=6.3
ARG GRADLE_DIST=bin
RUN cd /opt && \
wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-${GRADLE_DIST}.zip && \
unzip gradle*.zip && \
ls -d */ | sed 's/\/*$//g' | xargs -I{} mv {} gradle && \
rm gradle*.zip
ENV GRADLE_HOME /opt/gradle/bin
ENV PATH "$PATH:$GRADLE_HOME"
WORKDIR /tmp
RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
RUN unzip commandlinetools-*.zip
RUN rm ./commandlinetools*.zip
RUN mkdir $ANDROID_SDK_ROOT
RUN mv tools $ANDROID_SDK_ROOT
RUN mkdir "$ANDROID_SDK_ROOT/licenses"
WORKDIR /
RUN $ANDROID_SDK_ROOT/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --list
RUN yes | $ANDROID_SDK_ROOT/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "build-tools;28.0.3" "platform-tools" "platforms;android-28"
RUN yes | $ANDROID_SDK_ROOT/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --update
RUN yes | $ANDROID_SDK_ROOT/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
RUN apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
WORKDIR /