-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
75 lines (62 loc) · 2.32 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
FROM ubuntu:14.04.3
MAINTAINER Lewis Liu
ENV TOC_SETUP_PATH=/usr/local
WORKDIR /usr/local
# setting up various system packages
# required for serving, testing, android builds, etc
RUN apt-get update && \
apt-get install -y \
ant \
build-essential \
curl \
git \
lib32stdc++6 \
lib32z1 \
openjdk-7-jdk \
python && \
apt-get clean && \
rm -rf /tmp/* /var/tmp/*
# setting up environment variables
ENV TOC_BUNDLE_PATH=cache/bundle \
TOC_NODE_BUNDLE_NAME=node-v4.2.0-linux-x64.tar.gz \
TOC_ANDROID_BUNDLE_NAME=android-sdk_r24.3.4-linux.tgz \
DISPLAY=:1 \
ANDROID_HOME=$TOC_SETUP_PATH/android-sdk-linux \
PATH=$PATH:$TOC_SETUP_PATH/android-sdk-linux/tools:$TOC_SETUP_PATH/android-sdk-linux/platform-tools
# setup for local builds
# bundles should already be populated by vagrant
COPY $TOC_BUNDLE_PATH $TOC_SETUP_PATH
# setup for dockerhub
# bundles need to be downloaded for each build
ADD toc-setup-bundle.sh $TOC_SETUP_PATH/toc-setup-bundle.sh
# installing node and android sdk
RUN /bin/bash toc-setup-bundle.sh $TOC_SETUP_PATH && \
tar -xzf $TOC_NODE_BUNDLE_NAME --strip-components=1 --exclude='ChangeLog' \
--exclude='LICENSE' --exclude='README.md' && rm $TOC_NODE_BUNDLE_NAME && \
tar -xzf $TOC_ANDROID_BUNDLE_NAME && rm $TOC_ANDROID_BUNDLE_NAME && \
android list sdk --extended --all && \
echo "y" | android update sdk --no-ui --all -t build-tools-23.0.1 && \
echo "y" | android update sdk --no-ui --all -t platform-tools && \
echo "y" | android update sdk --no-ui --all -t tools && \
echo "y" | android update sdk --no-ui --all -t android-22
# installing npm dependencies
RUN npm install -g npm@3.3.8 && \
npm install -g cordova@5.3.3 && \
npm install -g gulp-cli@0.3.0 && \
npm install -g http-server@0.8.5 && \
npm install -g ionic@1.7.0 && \
npm install -g jspm@0.16.12 && \
npm cache clean
# replacing ionic-cli with custom fork for device livereload support
# https://github.com/driftyco/ionic-cli/issues/557
# RUN npm uninstall -g ionic
# RUN npm install -g ionic-no-cordova-mock@0.0.2 && npm cache clean
# adding volume mounts to cache android build dependencies
# and to allow use of persistent build certificates
VOLUME /root/.gradle
VOLUME /root/.android
# expose ionic serve, livereload
EXPOSE 8100 8101
WORKDIR /toc
# adding volume mounts for project files
VOLUME /toc