Image whitelist maintenance
The image whitelist maintenance system keeps the verifier's supported container-image references tied to exact published image digests. It also keeps installer checksums in generated Dockerfiles current so that image builds use known image content and verify downloaded installers before use.
Maintenance boundary
The repository has two related but separate pin sets. The image whitelist maps a Solana version to the digest of the published verifier image. Installer checksum pins protect the install script used by some versioned Dockerfiles.
| Pin | Purpose | Main consumer |
|---|---|---|
| Solana version to image digest | Select one approved verifier image for a requested version | The build command's default image selection |
| Installer URL to SHA-256 value | Check that a downloaded installer is the expected file | Versioned Dockerfiles that run an installer |
| Rust base image digest | Keep the build environment base image fixed | Generated Dockerfiles |
Approved image map
The approved image map is a generated version index. Each semantic version is stored as a three-part key and points to a registry digest, which lets the build system resolve a version without using a moving tag. The generated IMAGE_MAP in src/image_config.rs is the maintained result rather than a hand-edited policy file.
When a build does not receive an explicit base image, the verifier reads the Solana version from the workspace metadata or lock file and looks up that version in the map. A missing entry stops automatic selection and asks the caller to provide a base image instead; the legacy BPF path uses its own fixed image for compatibility.
References: src/image_config.rs• L1-8 src/main.rs• L949-975
Image whitelist updates
The update utility turns registry metadata into a new generated Rust map. It accepts only exact major.minor.patch tags, ignores the latest tag on Docker Hub, sorts the resulting versions, and writes the full generated file to src/image_config.rs.
Registry sources
The utility uses Docker Hub by default and reads all pages of tags for solanafoundation/solana-verifiable-build. An optional GHCR mode reads container versions from the GitHub package API and extracts semantic version tags from package metadata. In either mode, the value saved for a version is the published image digest.
The source choice matters when a registry changes or when the project moves its published images. USE_GHCR=true selects the GHCR path, and that path needs the GitHub token used by the API request. The normal workflow does not set this flag, so its default source is Docker Hub.
References: update_image_whitelist.py• L1-43 update_image_whitelist.py• L45-67
Generated output
The utility emits a complete IMAGE_MAP declaration with an autogenerated-file warning. It does not merge a small change into the existing map. A successful run replaces the file with the versions and digests found in the selected registry at that time.
This output is part of the build contract. The Rust build path imports the map directly, so a new published image becomes available only after the generated file is updated and accepted into the repository.
References: update_image_whitelist.py• L69-92 src/image_config.rs• L1-7 src/main.rs• L34-36
Whitelist update automation
The Update Docker Image Whitelist workflow runs the utility in a clean Ubuntu runner and opens a signed pull request with the generated change. It can run by hand, or it runs after a push to master that changes the docker/ directory.
Update flow
The workflow installs the repository's Python environment before it calls the utility. The pull-request step uses a dedicated branch and labels the result as automated image-whitelist work, which keeps registry changes separate from normal source changes.
The integration-test workflow includes test_verify_from_image in its test matrix. It builds the project and runs that case on pushes, pull requests, or manual runs, so image-selection changes have a CI check.
The following flow shows how a registry change reaches the build-time version map.
flowchart LR
A[Docker Hub or GHCR metadata] --> B[update_image_whitelist.py]
B --> C[src/image_config.rs]
C --> D[Signed pull request]
D --> E[IMAGE_MAP in verifier builds]
References: .github/…/update_whitelist.yaml• L1-18 .github/…/update_whitelist.yaml• L19-55 .github/…/test.yaml• L10-26 .github/…/test.yaml• L45-49 update_image_whitelist.py• L69-92
Installer checksum updates
Installer checksum maintenance uses the Dockerfile generator rather than the image whitelist utility. The generator downloads each install script, computes its SHA-256 value, and inserts that value into Dockerfiles that contain an installer placeholder.
Dockerfile verification
Generated Dockerfiles compare the checksum of the downloaded installer with the pinned value before they run the script. If the download cannot be read or the checksum cannot be fetched after retries, the generator leaves that Dockerfile unchanged and reports a warning instead of creating an unverified pin.
This check protects the installer layer independently from the image digest. A Dockerfile can therefore use a fixed Rust base image while also requiring an exact installer file.
References: generate_dockerfiles.py• L47-73 generate_dockerfiles.py• L351-361 docker/v4.1.2.Dockerfile• L1-11
Existing Dockerfile refresh
The Update Existing Dockerfile Installer Checksums workflow is a manual maintenance action. It asks the generator to skip its cache and update only Dockerfiles that already exist, so it refreshes old supported images without creating a new release set.
The workflow opens a separate signed pull request with the installer checksums label. This path is distinct from the whitelist workflow: one refreshes download checks in versioned Dockerfiles, while the other refreshes approved published-image digests in Rust source.
References: .github/…/update_existing_dockerfile_checksums.yml• L1-12 .github/…/update_existing_dockerfile_checksums.yml• L14-50 generate_dockerfiles.py• L11-21
Related automation
This page describes the data-maintenance part of repository automation. For the wider workflow triggers and checks, see GitHub workflow orchestration. For the release and publication lifecycle of versioned Dockerfiles, see Dockerfile publishing and releases. The parent overview is Repository automation and releases.
Change checklist
When these files or sections are changed, remember to consider these:
- If the published image registry or tag format changes, update the registry selection logic and confirm that the generated version keys still match the version lookup in the build path.
- If the generated map's key or digest format changes, update both the generator output and the Rust lookup contract together.
- If an installer URL or Dockerfile template changes, confirm that the checksum is fetched for the same URL that the Dockerfile downloads.
- If the automated pull-request branch or label changes, keep the maintenance workflow distinct from release and Dockerfile publication workflows.
- If image selection changes, keep
test_verify_from_imagein the integration-test matrix so CI still checks verification from an image.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A requested Solana version has no generated map entry | Automatic image selection fails and the caller must provide --base-image | Publish the exact version tag, then regenerate and merge src/image_config.rs |
| Registry metadata cannot be fetched | The whitelist update fails instead of producing a trusted digest map | Check registry access and rerun the workflow after the registry is available |
| The installer download changes or cannot be read | The Dockerfile is not given a new checksum, or its build fails at the checksum test | Refresh the checksum through the generator and review the generated Dockerfile change |
| A generated file is edited by hand | A later update can replace the edit and the map can drift from registry metadata | Treat src/image_config.rs as generated output and change the source utility or registry data |
test_verify_from_image is removed from the integration-test matrix | Image-based verification can change without this CI check | Keep the test in .github/…/test.yaml when image-selection behavior changes |
Key files
| File | Why to read it |
|---|---|
| update_image_whitelist.py | Defines the registry sources, version filtering, digest collection, and generated map output. |
| .github/…/update_whitelist.yaml | Shows when whitelist refreshes run and how they become signed pull requests. |
| .github/…/test.yaml | Shows the CI matrix and the image-based verification check that covers image-selection changes. |
| src/image_config.rs | Shows the generated version-to-digest contract used by the verifier. |
| src/main.rs | Shows how a workspace Solana version becomes a selected approved image or a clear failure. |
| generate_dockerfiles.py | Defines installer checksum retrieval and the limits for updating existing Dockerfiles. |
| .github/…/update_existing_dockerfile_checksums.yml | Shows the manual workflow for refreshing checksum pins in existing Dockerfiles. |
docker/v4.1.2.Dockerfile | Illustrates a generated Dockerfile with a pinned Rust base image and versioned build tools. |