Skip to content

Instantly share code, notes, and snippets.

@alisaesage
Created June 20, 2023 12:35
Show Gist options
  • Save alisaesage/d03ef5c67d04caccccbfba6747a2689d to your computer and use it in GitHub Desktop.
Save alisaesage/d03ef5c67d04caccccbfba6747a2689d to your computer and use it in GitHub Desktop.
Build v8 x64 on modern Linux
# Build v8 x64 on modern Linux
# Time to run: about 1.2hrs at 8Gb RAM / 8 cores, Ubuntu 22.04 LTS
# This dockerfile is part of Zero Day Engineering training materials on JavaScript engines internals and vulnerability research
# https://zerodayengineering.com
# @zerodaytraining
FROM ubuntu:bionic
MAINTAINER contact@zerodayengineering.com
RUN apt-get update && apt-get upgrade
RUN apt-get install -y sudo apt-utils --no-install-recommends
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
RUN echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
user docker
RUN sudo apt-get install -y file curl python python3 xz-utils git ca-certificates lsb-release --no-install-recommends
RUN mkdir ~/code
WORKDIR /home/docker/code
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH $PATH:/home/docker/code/depot_tools
RUN gclient
RUN fetch v8
WORKDIR v8
# git checkout ... // to build a specific version of v8
RUN gclient sync
RUN ./build/install-build-deps.sh
RUN tools/dev/gm.py x64.debug x64.release
# VOLUME /home/docker/code
# To export v8 code directory from container to host, do:
# docker run -it -v v8code:/home/docker/code/v8 v8build
# docker volume inspect v8code
# ln -s <path_to_v8code_docker_volume> ~/v8code
# Note that the volume will take extra 11G on host, and persist beyong docker image purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment