1- FROM ubuntu:16.04
1+ FROM ubuntu:latest
22
33# Sneak the stf executable into $PATH.
44ENV PATH /app/bin:$PATH
@@ -15,57 +15,57 @@ EXPOSE 3000
1515# installs development files for node-gyp so that npm install won't have to
1616# wait for them on the first native module installation.
1717RUN export DEBIAN_FRONTEND=noninteractive && \
18- useradd --system \
19- --create-home \
20- --shell /usr/sbin/nologin \
21- stf-build && \
22- useradd --system \
23- --create-home \
24- --shell /usr/sbin/nologin \
25- stf && \
26- sed -i'' 's@http://archive.ubuntu.com/ubuntu/@mirror://mirrors.ubuntu.com/mirrors.txt@' /etc/apt/sources.list && \
27- apt-get update && \
28- apt-get -y install wget python build-essential && \
29- cd /tmp && \
30- wget --progress=dot:mega \
31- https://nodejs.org/dist/v8 .9.3 /node-v8 .9.3 -linux-x64.tar.xz && \
32- tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \
33- rm node-v*.tar.xz && \
34- su stf-build -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' && \
35- apt-get -y install libzmq3-dev libprotobuf-dev git graphicsmagick openjdk-8-jdk yasm && \
36- apt-get clean && \
37- rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \
38- mkdir /tmp/bundletool && \
39- cd /tmp/bundletool && \
40- wget --progress=dot:mega \
41- https://github.com/google/bundletool/releases/download/1.2.0/bundletool-all-1.2.0.jar && \
42- mv bundletool-all-1.2.0.jar bundletool.jar
18+ useradd --system \
19+ --create-home \
20+ --shell /usr/sbin/nologin \
21+ stf-build && \
22+ useradd --system \
23+ --create-home \
24+ --shell /usr/sbin/nologin \
25+ stf && \
26+ sed -i'' 's@http://archive.ubuntu.com/ubuntu/@mirror://mirrors.ubuntu.com/mirrors.txt@' /etc/apt/sources.list && \
27+ apt-get update && \
28+ apt-get -y install wget python build-essential cmake && \
29+ cd /tmp && \
30+ wget --progress=dot:mega \
31+ https://nodejs.org/dist/v9 .9.0 /node-v9 .9.0 -linux-x64.tar.xz && \
32+ tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \
33+ rm node-v*.tar.xz && \
34+ su stf-build -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' && \
35+ apt-get -y install libzmq3-dev libprotobuf-dev git graphicsmagick openjdk-8-jdk yasm && \
36+ apt-get clean && \
37+ rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \
38+ mkdir /tmp/bundletool && \
39+ cd /tmp/bundletool && \
40+ wget --progress=dot:mega \
41+ https://github.com/google/bundletool/releases/download/1.2.0/bundletool-all-1.2.0.jar && \
42+ mv bundletool-all-1.2.0.jar bundletool.jar
4343
4444# Copy app source.
4545COPY . /tmp/build/
4646
4747# Give permissions to our build user.
4848RUN mkdir -p /app && \
49- chown -R stf-build:stf-build /tmp/build /tmp/bundletool /app
49+ chown -R stf-build:stf-build /tmp/build /tmp/bundletool /app
5050
5151# Switch over to the build user.
5252USER stf-build
5353
5454# Run the build.
5555RUN set -x && \
56- cd /tmp/build && \
57- export PATH=$PWD/node_modules/.bin:$PATH && \
58- npm install --loglevel http && \
59- npm pack && \
60- tar xzf devicefarmer-stf-*.tgz --strip-components 1 -C /app && \
61- bower cache clean && \
62- npm prune --production && \
63- mv node_modules /app && \
64- rm -rf ~/.node-gyp && \
65- mkdir /app/bundletool && \
66- mv /tmp/bundletool/* /app/bundletool && \
67- cd /app && \
68- find /tmp -mindepth 1 ! -regex '^/tmp/hsperfdata_root\( /.*\) ?' -delete
56+ cd /tmp/build && \
57+ export PATH=$PWD/node_modules/.bin:$PATH && \
58+ npm install --loglevel http && \
59+ npm pack && \
60+ tar xzf devicefarmer-stf-*.tgz --strip-components 1 -C /app && \
61+ bower cache clean && \
62+ npm prune --production && \
63+ mv node_modules /app && \
64+ rm -rf ~/.node-gyp && \
65+ mkdir /app/bundletool && \
66+ mv /tmp/bundletool/* /app/bundletool && \
67+ cd /app && \
68+ find /tmp -mindepth 1 ! -regex '^/tmp/hsperfdata_root\( /.*\) ?' -delete
6969
7070# Switch to the app user.
7171USER stf
0 commit comments