This directory contains the Dockerfiles for various images used by ClusterFuzz.
The build.sh script is the primary way to build images locally. It handles the complexities of build contexts and tagging for all images.
Ensure you are in the docker/ directory before running the script:
cd dockerThe script builds all images defined in its configuration. You must specify the Ubuntu version to build for.
# Usage: ./build.sh <ubuntu-version> [git-hash] [--no-push]<ubuntu-version>: (Required) The Ubuntu version to build (e.g.,20.04,24.04). The script will look for a corresponding.Dockerfilefor each image.git-hash: (Optional) A git hash to use for tagging the image. Defaults to the currentHEAD.--no-push: (Optional) A flag to prevent the script from pushing the built images to the container registry. This is useful for local testing.
1. Build all ubuntu-24.04 images for local testing:
./build.sh ubuntu-24-04 --no-push2. Build and push all ubuntu-20.04 images:
./build.sh ubuntu-20.04While using build.sh is recommended, you can build a specific image manually. You must run the docker build command from the root of the clusterfuzz repository.
For example, to build the base image for ubuntu-24.04:
# Note: This command requires manually handling the build context.
# The build.sh script handles this automatically.
docker build -f docker/base/ubuntu-24-04.Dockerfile docker/baseProduction images are built using Google Cloud Build. The configuration is defined in cloudbuild.yaml, which uses the build.sh script. The build process is automated with the following triggers:
- Pull Requests: A trigger runs on every pull request that modifies files under the
docker/directory. It builds all images with the--no-pushflag to validate the changes without deploying them. - Push to
master: A trigger runs on every push to themasterbranch that modifies files under thedocker/directory. It builds and pushes all images to the container registry, making them available for production use.
graph TD
subgraph Base Images
A(base)
end
subgraph Chromium
F(chromium/base)
K(chromium/tester)
L(chromium/python-profiler)
M(chromium/high-end)
E(chromium/tests-syncer)
G(chromium/builder)
end
subgraph OSS-Fuzz
H(oss-fuzz/base)
N(oss-fuzz/worker)
O(oss-fuzz/host)
P(oss-fuzz/host-high-end)
end
subgraph General
B(ci)
C(utask-main-scheduler)
D(fuchsia)
I(tworker)
J(high-end)
end
A --> B;
A --> C;
A --> D;
A --> E;
A --> F;
A --> G;
A --> H;
A --> I;
A --> J;
F --> K;
F --> L;
F --> M;
H --> N;
H --> O;
O --> P;