-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile-phpv8js
23 lines (22 loc) · 1021 Bytes
/
Dockerfile-phpv8js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
git \
python \
make \
gcc \
chrpath \
&& 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 --with_branch_heads \
&& 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 \
&& pecl install v8js && docker-php-ext-enable v8js \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rfv /usr/local/src/v8 \
&& rm -rfv /tmp/depot_tools