-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathDockerfile
55 lines (53 loc) · 1.21 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
FROM alpine:latest
ENV PHANTOMJS_VERSION 2.1.1
COPY *.patch /
RUN apk add --no-cache --virtual .build-deps \
bison \
flex \
fontconfig-dev \
freetype-dev \
g++ \
gcc \
git \
gperf \
icu-dev \
libc-dev \
libjpeg-turbo-dev \
libpng-dev \
libx11-dev \
libxext-dev \
linux-headers \
make \
openssl-dev \
paxctl \
perl \
python \
ruby \
sqlite-dev \
&& mkdir -p /usr/src \
&& cd /usr/src \
&& git clone git://github.com/ariya/phantomjs.git \
&& cd phantomjs \
&& git checkout $PHANTOMJS_VERSION \
&& git submodule init \
&& git submodule update \
&& for i in qtbase qtwebkit; do \
cd /usr/src/phantomjs/src/qt/$i \
&& patch -p1 -i /$i*.patch || break; \
done \
&& cd /usr/src/phantomjs \
&& patch -p1 -i /build.patch \
&& python build.py --confirm \
&& paxctl -cm bin/phantomjs \
&& strip --strip-all bin/phantomjs \
&& install -m755 bin/phantomjs /usr/bin/phantomjs \
&& runDeps="$( \
scanelf --needed --nobanner /usr/bin/phantomjs \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .phantomjs-rundeps $runDeps \
&& apk del .build-deps \
&& rm -r /*.patch /usr/src