build.yml to describe what your repository should build. The generator reads this file from the repository root.
Schema
Use the shipped schema for editor validation:Top-level fields
version
String value for the config version. The repository samples use v1beta.
variables
Variables become Bake variables and are also exposed through the generated _common target args.
Supported forms:
plugins
Optional list of plugin names:
targets
Required mapping of source path to one or more target definitions.
You must define exactly one build target across the whole file.
Supported forms:
Single scalar:
with block:
types
Optional type-level contexts and matrix expansion.
Use types.<type>.contexts when every generated target of the same type should receive the same Docker Bake named context:
types.<type>.matrix when you want to expand every target of a given type across one or more axes:
docker-bake.hcl, the publish target becomes a Bake matrix with:
- One
itementry for the source target - One
runtimeaxis with both values - A target name pattern such as
${item.name}_${runtime} - An injected build arg
RUNTIME="${runtime}"
type: publish definition expands into two generated publish variants, one for win-x64 and one for win-arm64.
Target keys
with
Each target can define these supported options under with.
Notes:
contextsis a mapping of HCL identifier names to non-empty context values.- Use
docker-image://...when a chart Dockerfile expects a named image context such asbase. - The context name
buildis reserved. BuildCharts automatically wires non-buildtargets totarget:build. argsvalues can be strings or arrays- Array values are emitted as comma-separated strings in the generated HCL
- If you omit
dockerfile, BuildCharts uses./.buildcharts/<chart-name>/Dockerfile
Alias resolution
Each targettype must match an alias in charts/buildcharts/Chart.yaml. If you define type: publish, you also need a chart dependency whose alias is publish.
