-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
91 lines (72 loc) · 2.56 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM openjdk:8
RUN mkdir /opt/app
WORKDIR /opt/app
RUN apt-get update && apt-get install -y curl \
&& curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
&& apt-get update && apt-get install -y google-chrome-stable
RUN set -x; \
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh \
&& chmod +x nodesource_setup.sh \
&& ./nodesource_setup.sh \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nodejs \
file \
git \
curl \
zip \
libncurses5:i386 \
libstdc++6:i386 zlib1g:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ./nodesource_setup.sh
ENV ANDROID_HOME="/root/android-sdk-linux" \
ANDROID_SDK_VERSION=27.0.2
ENV PATH="/root/gradle/bin:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/${ANDROID_SDK_VERSION}:/opt/app/node_modules/.bin:${PATH}"
# Download Android SDK
RUN mkdir "$ANDROID_HOME" .android \
&& cd "$ANDROID_HOME" \
&& curl -Lo sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip \
&& unzip sdk.zip \
&& rm sdk.zip \
&& yes | sdkmanager --licenses
RUN sdkmanager "build-tools;$ANDROID_SDK_VERSION"
# Install Gradle
RUN cd /root \
&& curl -Lo gradle.zip https://services.gradle.org/distributions/gradle-4.1-all.zip \
&& unzip gradle.zip \
&& mv gradle-4.1 gradle \
&& mkdir .gradle
RUN npm install -g cordova
RUN cordova telemetry off
RUN echo '{ "allow_root": true }' > /root/.bowerrc
COPY ./package.json ./bower.json ./
RUN npm install && bower install
COPY ./config.xml ./
COPY ./hooks ./hooks
COPY ./www/img ./www/img
COPY ./ionic.project ./
RUN mkdir ./platforms ./plugins
# `cordova platform add android` returns non-zero for some reason
RUN cordova platform add android --verbose; true
RUN cordova plugin add [email protected]
RUN cordova plugin add de.appplant.cordova.plugin.local-notification
# Build Gradle wrapper
ENV CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=gradle.zip
RUN mkdir -p platforms/android/gradle/wrapper \
&& mv /root/gradle.zip platforms/android/gradle/wrapper \
&& cordova clean
COPY ./.eslintrc \
./build.sh \
./gulpfile.js \
./
COPY ./config ./config
COPY ./gulp ./gulp
COPY ./scss ./scss
COPY ./test ./test
COPY ./www/index.html ./www/index.html
COPY ./www/js ./www/js
COPY ./www/templates ./www/templates
# The first gulp build is expected to fail.
RUN gulp build; gulp build