docker-bake.hcl file because Docker Buildx Bake is the execution layer for the build plan.
What Bake is
Docker describes Bake as a declarative way to define build configuration, instead of rebuilding complexdocker build commands from CLI flags on every run.
In BuildCharts, that means:
build.ymldefines build intentChart.yamlmaps target types to OCI-hosted implementationsbuildcharts generaterenders the finaldocker-bake.hcldocker buildx bakeexecutes the generated plan
Why BuildCharts uses Bake
Bake fits BuildCharts well because it provides:- Declarative build configuration in a file instead of long CLI commands
- A native way to run multiple targets in parallel
- Groups and targets that map cleanly to BuildCharts stage types
- A structured place for args, tags, outputs, contexts, entitlements, provenance, and SBOM settings
- A standard Docker-native interface that works locally and in CI
Benefits for BuildCharts users
Simpler execution
After generation, the runtime command is predictable:Parallel targets
Bake runs specified targets in parallel. This is useful in BuildCharts because a repository can generate separatebuild, test, nuget, and docker targets from one metadata model.
Single target
You can run a single target when you only want one stage. For example, run only tests with:Better reuse of shared configuration
Bake groups related targets and centralizes shared settings. BuildCharts uses that to emit common variables and target-level configuration without duplicating command-line flags per step.Easier inspection and debugging
Bake supports commands such as:docker buildx bake --printdocker buildx bake --listdocker buildx history lsdocker buildx history inspect
Better fit for advanced Docker build features
Bake exposes first-class support for features that matter in BuildCharts:- outputs
- multi-platform builds
- cache configuration
- entitlements
- provenance and SBOM attestation
- target overrides with
--set
SBOM and provenance
There are two related but separate concerns:- securing the chart artifact itself
- securing the images and outputs produced by the generated build
- provenance
- SBOM
docker-bake.hcl is executed by Docker Buildx, which already supports provenance and SBOM attestations in the image build flow.