-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathDockerfile
49 lines (39 loc) · 1.52 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
FROM ubuntu:xenial
LABEL MAINTAINER="Weerayut Hongsa <[email protected]>"
ARG NODEJS_VERSION="10"
ARG IONIC_VERSION="4.2.1"
ARG ANDROID_SDK_VERSION="3859397"
ARG ANDROID_HOME="/opt/android-sdk"
ARG ANDROID_BUILD_TOOLS_VERSION="26.0.2"
# 1) Install system package dependencies
# 2) Install Nodejs/NPM/Ionic-Cli
# 3) Install Android SDK
# 4) Install SDK tool for support ionic build command
# 5) Cleanup
# 6) Add and set user for use by ionic and set work folder
ENV ANDROID_HOME "${ANDROID_HOME}"
RUN apt-get update \
&& apt-get install -y \
build-essential \
openjdk-8-jre \
openjdk-8-jdk \
curl \
unzip \
git \
gradle \
&& curl -sL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs \
&& npm install -g cordova ionic@${IONIC_VERSION} \
&& cd /tmp \
&& curl -fSLk https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip -o sdk-tools-linux-${ANDROID_SDK_VERSION}.zip \
&& unzip sdk-tools-linux-${ANDROID_SDK_VERSION}.zip \
&& mkdir /opt/android-sdk \
&& mv tools /opt/android-sdk \
&& (while sleep 3; do echo "y"; done) | $ANDROID_HOME/tools/bin/sdkmanager --licenses \
&& $ANDROID_HOME/tools/bin/sdkmanager "platform-tools" \
&& $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
&& apt-get autoremove -y \
&& rm -rf /tmp/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip \
&& mkdir /ionicapp
WORKDIR /ionicapp