Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Optimized Containers for Iteration on the Chromium integration #1

Open
frank-dspeed opened this issue Mar 26, 2020 · 1 comment

Comments

@frank-dspeed
Copy link
Member

frank-dspeed commented Mar 26, 2020

requested goma access.

@frank-dspeed
Copy link
Member Author

FROM buildpack-deps:focal-curl

RUN \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
    && perl -pi -e 's/archive.ubuntu.com/us.archive.ubuntu.com/' /etc/apt/sources.list \
    && apt-get update -y

RUN \
    apt-get install -y \
        build-essential \
        curl \
        git \
        lsb-base \
        lsb-release \
        sudo

RUN \
    cd / \
    && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

RUN \
    echo Etc/UTC > /etc/timezone

RUN \
    echo tzdata tzdata/Areas select Etc | debconf-set-selections

RUN \
    echo tzdata tzdata/Zones/Etc UTC | debconf-set-selections

RUN \
    echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections

ENV PATH=/depot_tools:$PATH

RUN \
    curl -s https://chromium.googlesource.com/chromium/src/+/master/build/install-build-deps.sh?format=TEXT | base64 -d \
    | perl -pe 's/if new_list.*/new_list=\$packages\nif false; then/' \
    | sed -e '/^  new_list/,+2d' \
    | perl -pe 's/apt-get install \$\{do_quietly-}/DEBIAN_FRONTEND=noninteractive apt-get install -y/' \
    | bash -e -s - \
        --no-syms \
        --no-arm \
        --no-chromeos-fonts \
        --no-nacl \
        --no-prompt \
        --unsupported

RUN \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Note: you will need to have the Chromium source tree already on disk.

Running

You can use this Docker image in the usual way:

# updated to latest version of chromium-builder
$ docker pull chromedp/chromium-builder

# build latest chrome version
$ docker run -it -v /path/to/chromium:/chromium -v /path/to/build:/build --rm chromedp/chromium-builder /build/build.sh

For example, if you have the Chromium source tree checked out to
/media/src/chromium, and have the [headless-shell][headless-shell] Docker
source checked out to ~/src/docker/headless-shell, you can build the latest
headless-shell using the build-headless-shell.sh script via the following:

$ docker run -it \
    -v /media/src/chromium:/chromium \
    -v ~/src/docker/headless-shell:/build \
    --rm \
    chromedp/chromium-builder \
    /build/build-headless-shell.sh /

Building Image

The Docker image can be manually built the usual way:

# clone the repository
$ cd ~/src/ && git clone https://github.com/chromedp/docker-chromium-builder.git chromium-builder

# docker build
$ cd ~/src/chromium-builder && docker build -t chromedp/chromium-builder .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant