Introducing a new way to review your PRs.

Read the announcement

solana-foundation / solana-verifiable-build

CLI tool for deterministically building and verifying executable against on-chain programs or buffer accounts

View on GitHub

18 documents · Updated Nov 23, 2026

docs / image-configuration

Build image configuration

Build image configuration selects the container image that supplies the Solana and Rust toolchain for a program build. The verifier uses the program's declared Solana version as the lookup key and uses an immutable image digest when it selects a supported image. This page complements Verifier CLI, Build verification execution, Solana program artifacts, Verified programs API integration, and Container build environments.

Configuration role

The build image is the container environment in which the verifier runs the program build. It supplies the tools that must match the program's Solana release so that the produced program artifact can be compared with the expected artifact.

The image choice affects build commands that create a program binary. It does not affect verify-from-image, which receives an image from the caller because that command verifies a build that already exists in a container.

Environment identity

Each supported environment has two related identities:

  • A semantic version such as 1.18.26, which identifies the Solana release expected by the program.
  • A container digest, which identifies the exact published image used for the build.

The verifier turns a supported version into an image reference in the form solanafoundation/solana-verifiable-build@<digest>. The digest makes the selected environment stable even if a registry later changes a tag.

References: src/main.rs• L947-975 src/image_config.rs• L1-8

Version resolution

The verifier resolves one three-part Solana version before it selects an image. It first checks workspace metadata and then uses the lockfile as a fallback, so a project can state its intended CLI version directly while older or different workspace layouts can still use the dependency version.

The resolution path is:

flowchart TD
    A[Build request] --> B{Custom base image?}
    B -->|Yes| C[Use caller image]
    B -->|No| D[Read workspace Solana metadata]
    D -->|Version found| F[Look up version in image map]
    D -->|No version| E[Read supported Solana package from Cargo.lock]
    E -->|Version found| F
    E -->|No version| G[Stop with version error]
    F -->|Digest found| H[Use digest-pinned image]
    F -->|No digest| I[Stop and request a compatible image]

Workspace metadata

The preferred source is the root Cargo.toml for the mounted project. The verifier reads the solana value under [workspace.metadata.cli] and accepts only a three-part numeric version such as 1.18.26.

This source states the build environment choice explicitly. For a monorepo, the metadata lookup uses the mount path while the lockfile lookup uses the selected workspace path, so those paths must point to the intended project roots.

References: src/main.rs• L949-961 src/main.rs• L1649-1669

Lockfile fallback

If workspace metadata does not provide a usable version, the verifier reads Cargo.lock. It checks the Solana program package family in a fixed order: solana-program, then solana-program-error, then solana-account-info.

The first matching package version becomes the image-map key. A project without Cargo.lock fails before image selection because the lockfile also records the dependency set used by the build.

References: src/main.rs• L930-961 src/main.rs• L1671-1704

Image selection

The image map is the allowlist of Solana versions that have a supported published build environment. It maps a numeric version tuple to an image digest and prevents automatic builds from silently using an unapproved or moving image tag.

Supported image map

IMAGE_MAP is a generated map. Its keys are (major, minor, patch) values and its values are digest strings. The current entries cover supported releases from Solana 1.10.1 through 4.3.0, although not every patch release in that range is present. The verifier uses the map only after it has resolved a version from the project.

The map is not a general version converter. A valid Solana version that has no entry is unsupported for automatic selection. The caller must then provide a compatible image with --base-image, or the build stops with an actionable error.

References: src/image_config.rs• L1-301 src/main.rs• L951-973

Custom image override

The --base-image option lets the caller supply the full container image reference. This override is available to the direct build flow and to repository verification flows that build the source before checking its result.

The override transfers compatibility responsibility to the caller. The verifier does not use the allowlist to validate a custom image, so the image must already contain the correct Solana build tools and a suitable Rust toolchain for the source being built.

References: src/main.rs• L136-171 src/main.rs• L210-281 src/main.rs• L908-975

Legacy BPF environment

The --bpf option is a separate compatibility path for programs that require cargo build-bpf. It selects a fixed legacy image instead of consulting the current image map, which keeps older Anchor-verified builds on the environment they expect.

This path is distinct from the normal cargo build-sbf path. A change to the regular version map does not update the legacy BPF environment.

References: src/main.rs• L947-975 src/main.rs• L1041-1080

Image representation

The version map represents an environment by its published image digest rather than by the version tag alone. The corresponding versioned Dockerfiles define the toolchain and platform tools that are baked into each environment before the verifier mounts the source and runs the build.

The Dockerfile set includes historical Solana releases and newer releases. This lets the verifier reproduce builds across release lines while keeping each selected environment tied to one immutable image identity. See Container build environments for the broader environment catalog.

References: src/image_config.rs• L1-301 docker/v1.18.26.Dockerfile• L1-18 docker/v4.1.2.Dockerfile• L1-14

Image map maintenance

The image map follows published image metadata rather than manual edits. The maintenance script reads versioned image tags from the configured container registry, records the matching digest for each three-part version, sorts the entries, and rewrites the generated Rust source.

The repository workflow runs this update when Dockerfile content changes or when a maintainer starts it manually. It opens a pull request with the generated map, which keeps newly published environments available to automatic version selection without making the verifier resolve registry tags at build time.

References: update_image_whitelist.py• L10-18 update_image_whitelist.py• L33-67 update_image_whitelist.py• L69-92 .github/…/update_whitelist.yaml• L1-53

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to Solana version sources must preserve the three-part version key expected by IMAGE_MAP and the fallback package order.
  • New or republished container environments must update the generated digest map. A version tag alone does not make an image selectable.
  • Changes to Dockerfile release names or registry sources must keep the whitelist update script and its workflow aligned with the published image metadata.
  • Changes to --base-image propagation must be checked across build, verify-from-repo, and export-pda-tx, because each flow can reach the same build selector.
  • Changes to the legacy --bpf path must preserve its separate fixed environment unless compatibility with older BPF builds is intentionally dropped.

Important failure modes

TriggerConsequenceGuard
The mount or workspace root has no Cargo.lock.The verifier stops before it can resolve a default image.Keep the lockfile at the workspace root used for the build, or pass a valid workspace path.
Neither workspace metadata nor a supported Solana package in Cargo.lock provides a three-part version.Automatic image selection fails because there is no lookup key.Add [workspace.metadata.cli].solana or keep one of the supported Solana packages in the lockfile.
The resolved version has no entry in IMAGE_MAP.The build stops instead of selecting an unknown image.Use a published supported version or pass a compatible --base-image.
A digest in the generated map does not point to a pullable image.Docker cannot start the build container.Regenerate the map from the registry and review the image update before merge.
A custom image does not contain the expected Solana build tools or Rust toolchain.The build can fail or produce an artifact that cannot be compared with the expected build.Treat custom-image compatibility as the caller's responsibility and pin the image when reproducibility matters.

Key files

FileWhy to read it
src/main.rsConnects CLI image options to version resolution, image selection, container startup, and build-tool choice.
src/image_config.rsHolds the generated version-to-digest allowlist used for automatic selection.
update_image_whitelist.pyDefines how published image versions become digest entries in the allowlist.
.github/…/update_whitelist.yamlShows when the generated allowlist is refreshed and reviewed.
docker/v1.18.26.DockerfileIllustrates a historical versioned environment with a pinned Rust base and Solana tools.
docker/v4.1.2.DockerfileIllustrates a newer versioned environment and its release-specific build tool setup.