Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (37 loc) · 1.83 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (37 loc) · 1.83 KB
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
FROM node:latest
MAINTAINER authors="Andrew Dabich <andabich@gmail.com>"
# add more arguments from CI to the image so that `$ env` should reveal more info
ARG CI_BUILD_ID
ARG CI_BUILD_REF
ARG CI_REGISTRY_IMAGE
ARG CI_PROJECT_NAME
ARG CI_BUILD_REF_NAME
ARG CI_BUILD_TIME
ARG CI_BUILD_NUMBER
ARG CI_BUILDER
ARG NG_CLI_VERSION=latest
ENV CI_BUILD_ID=$CI_BUILD_ID CI_BUILD_REF=$CI_BUILD_REF CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE \
CI_PROJECT_NAME=$CI_PROJECT_NAME CI_BUILD_REF_NAME=$CI_BUILD_REF_NAME CI_BUILD_TIME=$CI_BUILD_TIME \
CI_BUILD_NUMBER=$CI_BUILD_NUMBER CI_BUILDER=$CI_BUILDER \
NG_CLI_VERSION=$NG_CLI_VERSION
# credits to https://github.com/emmenko/docker-nodejs-karma
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c '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 Xvfb google-chrome-stable \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get update; \
apt-get install -y git curl; \
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -; \
curl https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - ; \
sh -c '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 nodejs Xvfb; \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ADD xvfb.sh /etc/init.d/xvfb
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /etc/init.d/xvfb \
&& chmod +x /entrypoint.sh
ENV DISPLAY :99.0
ENV CHROME_BIN /usr/bin/google-chrome
RUN yarn global add @angular/cli@$NG_CLI_VERSION phantomjs-prebuilt && rm -rf $(yarn cache dir)
RUN ng set --global warnings.versionMismatch=false
# ENTRYPOINT ["/entrypoint.sh"]