forked from wernight/docker-phantomjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (35 loc) · 1.2 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
FROM debian:jessie
# Install runtime dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bzip2 \
libfontconfig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
# Install official PhantomJS release
&& apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
&& mkdir /tmp/phantomjs \
&& curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
| tar -xj --strip-components=1 -C /tmp/phantomjs \
&& mv /tmp/phantomjs/bin/phantomjs /usr/local/bin \
# Install dumb-init (to handle PID 1 correctly).
# https://github.com/Yelp/dumb-init
&& curl -Lo /tmp/dumb-init.deb https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64.deb \
&& dpkg -i /tmp/dumb-init.deb \
# Clean up
&& apt-get purge --auto-remove -y \
curl \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* \
\
# Run as non-root user.
&& useradd --system --uid 72379 -m --shell /usr/sbin/nologin phantomjs \
&& su phantomjs -s /bin/sh -c "phantomjs --version"
USER phantomjs
EXPOSE 8910
ENTRYPOINT ["dumb-init"]
CMD ["phantomjs"]