forked from marcoturi/ionic-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
71 lines (61 loc) · 2.99 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 debian:jessie
MAINTAINER marco [dot] turi [at] hotmail [dot] it
ENV DEBIAN_FRONTEND=noninteractive \
ANDROID_HOME=/opt/android-sdk-linux \
NPM_VERSION=6.0.1 \
IONIC_VERSION=3.20.0 \
CORDOVA_VERSION=8.0.0 \
YARN_VERSION=1.6.0 \
GRADLE_VERSION=4.4.1 \
# Fix for the issue with Selenium, as described here:
# https://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS=/dev/null
# Install basics
RUN apt-get update && \
apt-get install -y git wget curl unzip build-essential && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get update && \
apt-get install -y nodejs && \
npm install -g npm@"$NPM_VERSION" cordova@"$CORDOVA_VERSION" ionic@"$IONIC_VERSION" yarn@"$YARN_VERSION" && \
npm cache clear --force && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
dpkg --unpack google-chrome-stable_current_amd64.deb && \
apt-get install -f -y && \
apt-get clean && \
rm google-chrome-stable_current_amd64.deb && \
mkdir Sources && \
mkdir -p /root/.cache/yarn/ && \
# Font libraries
apt-get -qqy install fonts-ipafont-gothic xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable libfreetype6 libfontconfig && \
# install python-software-properties (so you can do add-apt-repository)
apt-get update && apt-get install -y -q python-software-properties software-properties-common && \
add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" -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 && \
# System libs for android enviroment
echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --force-yes expect ant wget 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 Tools
mkdir /opt/android-sdk-linux && cd /opt/android-sdk-linux && \
wget --output-document=android-tools-sdk.zip --quiet https://dl.google.com/android/repository/tools_r25.2.3-linux.zip && \
unzip -q android-tools-sdk.zip && \
rm -f android-tools-sdk.zip && \
# Install Gradle
mkdir /opt/gradle && cd /opt/gradle && \
wget --output-document=gradle.zip --quiet https://services.gradle.org/distributions/gradle-"$GRADLE_VERSION"-bin.zip && \
unzip -q gradle.zip && \
rm -f gradle.zip && \
chown -R root. /opt
# Setup environment
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/gradle/gradle-${GRADLE_VERSION}/bin
# Install Android SDK
RUN yes Y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;25.0.2" "platforms;android-25" "platform-tools"
RUN cordova telemetry off
WORKDIR Sources
EXPOSE 8100 35729
CMD ["ionic", "serve"]