docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.81k stars 2k forks source link

Request support v8js extension, try myself in the mirror for a long time haven't successful installation #285

Closed wsdo closed 6 years ago

shouze commented 8 years ago

@wshudong it's not related to docker php by itself, more related to how configure & compile v8js ext on any system, you should close this issue I guess.

hu19891110 commented 6 years ago

Me too.

tianon commented 6 years ago

In order to make this work, you'll have to compile a newer version of v8 than Debian packages. See the v8js image for an example: https://hub.docker.com/r/stesie/v8js/~/dockerfile/

...
    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 && \
...

Then you'll likely want to use pecl to install v8js.

hu19891110 commented 6 years ago

@tianon thanks!