Skip to main content

Module bake

Module bake 

Source
Expand description

Bake artifact discovery — single source of truth for “which docker-bake.hcl files compose the fleet’s build graph.” Used by src/build.rs (the CLI), tests/common/mod.rs (test bootstraps), and tests/build/test.rs (the principle-15 lint). Per RULES.md principle 11 (Reuse over repetition): one home for the category list, the seed file, and the walker.

Constants§

ARTIFACT_CATEGORIES
The five artifact categories whose subdirectories ship Dockerfiles and docker-bake.hcl files per RULES.md principle 15. Adding a sixth category is the only place this constant changes.
COMBINATION_BAKE_FILE
Path to the parameterized eval combination template.
ROOT_BAKE_FILE
Path to the root bake file. Declares fleet-wide variables (REGISTRY) that per-artifact files reference via ${REGISTRY}/... without redeclaring (principle 11 — reuse over repetition).

Functions§

artifact_bake_files
Every docker-bake.hcl in the fleet, plus the root and combination seeds. Order doesn’t matter — bake merges by target name.
artifact_dirs_with_dockerfile
Every artifact directory (a subdirectory of one of the five categories) that contains a Dockerfile. Sorted for stable test failure output.
base_args
Construct the docker buildx bake argument list for the given targets and --set overrides. Bake files come from artifact_bake_files. With no builder, --load is appended so the result lands in the local image store; with a named builder (a remote/in-cluster BuildKit), --builder <name> --push is appended instead, since a remote builder can’t load into local Docker.