This git repo contains a Dockerfile to create a Docker Image that build the latest stable V8 and all it's variants.
How to use it?
Pull the latest container image built by polyverse team from docker hub: https://hub.docker.com/r/polyverse/v8/
docker pull polyverse/v8
Get V8 binaries by opening it up and/or mounting a volume into it
#docker run -it -v .:/external v8 bash
#cp /v8/v8/out/x64.release/target.out/libv8.so /external
Pull whatever binary you want out of the image.
How to build it yourself?
#git clone https://github.com/polyverse-security/v8.git
#docker build -t v8 .
Now in your v8 docker image, you'll have V8 built from the latest stable branch tip, using all the necessary build environment and tools with the latest patches.
The instructions here are WAY simpler than figuring out how to build V8, how to find out what the current latest released stable is, where branch is, what version of GYP to install and where, what compiler chains are needed and so on and so forth.
Stable V8 Selection
We pick the latest stable branch-head for V8 based on the release process described here: https://github.com/v8/v8/wiki/Release-Process
We verified that the googlesource branch-heads roughly correspond to <branch-major-version.branch-minor-version>-lkgr on the github mirror.
For instance, what would be https://chromium.googlesource.com/v8/v8.git/+/branch-heads/4.4 on googlesource, becomes https://github.com/v8/v8/tree/4.5-lkgr on github.
The current stable release for V8 is chosen from omahaproxy (the same source used by other V8 consumers as well.)
Currently no effort is made to ensure versioning or locking of the build toolchain. The docker file downloads the absolute latest published packages for gcc, g++, clang, and so forth.
For completeness of this build, if you can find a way to cross-compile Windows and Mac libraries inside an ubuntu image, we'd appreciate the contribution. It would provide a single-place to get all your needs built without contaminating your desktop. Arguably installing build toolchains on Mac or Windows is a lot more painful than simply running docker build.