forked from stesie/docker-v8js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (34 loc) · 1.65 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
FROM phusion/baseimage:latest
MAINTAINER Stefan Siegl <[email protected]>
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git subversion make g++ python2.7 curl php7.0-cli php7.0-dev chrpath wget bzip2 && \
ln -s /usr/bin/python2.7 /usr/bin/python && \
\
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /tmp/depot_tools && \
export PATH="$PATH:/tmp/depot_tools" && \
\
cd /usr/local/src && fetch v8 && cd v8 && \
git checkout 5.4.500.40 && gclient sync && \
export GYPFLAGS="-Dv8_use_external_startup_data=0" && \
export GYPFLAGS="${GYPFLAGS} -Dlinux_use_bundled_gold=0" && \
make native library=shared snapshot=on -j4 && \
\
mkdir -p /usr/local/lib && \
cp /usr/local/src/v8/out/native/lib.target/lib*.so /usr/local/lib && \
echo "create /usr/local/lib/libv8_libplatform.a\naddlib out/native/obj.target/src/libv8_libplatform.a\nsave\nend" | ar -M && \
cp -R /usr/local/src/v8/include /usr/local && \
chrpath -r '$ORIGIN' /usr/local/lib/libv8.so && \
\
git clone https://github.com/phpv8/v8js.git /usr/local/src/v8js && \
cd /usr/local/src/v8js && phpize && ./configure --with-v8js=/usr/local && \
export NO_INTERACTION=1 && make all -j4 && make test install && \
\
echo extension=v8js.so > /etc/php/7.0/cli/conf.d/99-v8js.ini && \
\
cd /tmp && \
rm -rf /tmp/depot_tools /usr/local/src/v8 /usr/local/src/v8js && \
apt-get remove -y subversion make g++ python2.7 curl php7.0-dev chrpath wget bzip2 && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*