-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
71 lines (56 loc) · 2.74 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
60
61
62
63
64
65
66
67
68
69
70
71
FROM ubuntu:16.04
LABEL maintainer="lucas@lapou.com.br"
ENV DEBIAN_FRONTEND=noninteractive \
ANDROID_HOME=/opt/android-sdk-linux \
NODE_VERSION=8.9.1 \
IONIC_VERSION=3.19.1 \
CORDOVA_VERSION=7.0.0 \
GRADLE_VERSION=4.5.1
# Install basics
RUN apt-get update && \
apt-get install -y git wget curl unzip ruby ruby-dev gcc make
RUN curl --retry 3 -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" && \
tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 && \
rm "node-v$NODE_VERSION-linux-x64.tar.gz" && \
npm install -g cordova@"$CORDOVA_VERSION" && \
npm install -g ionic@"$IONIC_VERSION" && \
npm cache clear --force && \
gem install sass --no-user-install && \
ionic start myApp sidemenu --no-interactive --no-git --no-link
#ANDROID
#JAVA
# install python-software-properties (so you can do add-apt-repository)
RUN apt-get update && apt-get install -y -q python-software-properties software-properties-common && \
add-apt-repository ppa:webupd8team/java -y && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
apt-get update && apt-get -y install oracle-java8-installer
#ANDROID STUFF
RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --force-yes expect ant wget zipalign libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && \
apt-get clean && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Android SDK
RUN cd /opt && \
wget --output-document=android-sdk.tgz --quiet http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && \
tar xzf android-sdk.tgz && \
rm -f android-sdk.tgz && \
chown -R root. /opt
# Install Gradle
RUN wget https://services.gradle.org/distributions/gradle-"$GRADLE_VERSION"-bin.zip && \
mkdir /opt/gradle && \
unzip -d /opt/gradle gradle-"$GRADLE_VERSION"-bin.zip && \
rm -rf gradle-"$GRADLE_VERSION"-bin.zip
# Setup environment
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/tools:/opt/gradle/gradle-"$GRADLE_VERSION"/bin
# Install sdk elements
COPY tools /opt/tools
RUN ["/opt/tools/android-accept-licenses.sh", "android update sdk --all --no-ui --filter platform-tools,tools,build-tools-26.0.0,android-26,build-tools-25.0.0,android-25,extra-android-support,extra-android-m2repository,extra-google-m2repository"]
RUN unzip ${ANDROID_HOME}/temp/*.zip -d ${ANDROID_HOME}
# Test First Build so that it will be faster later
RUN cd myApp && \
ionic cordova build android --prod --no-interactive --release
WORKDIR myApp
EXPOSE 8100 35729