targets in build.yml to describe the stages BuildCharts should generate.
Start with one build stage
Everybuild.yml must contain exactly one target with type: build.
buildcharts generate.
Add more stages to a project
A project can declare multiple stages by using a sequence:type must match an alias in charts/buildcharts/Chart.yaml.
Use built-in target variables
Every generated target gets a small set of built-in build args automatically. For example:| Variable | Meaning |
|---|---|
BUILDCHARTS_SRC | The target source path, for example src/MyApp/MyApp.csproj |
BUILDCHARTS_TYPE | The generated target type, for example build |
BUILDCHARTS_SRC lets a chart know which source entry it is building, and BUILDCHARTS_TYPE identifies the resolved stage type behind the chart alias.
Reuse one with block across multiple stages
If stages share the same configuration, use type: [build, test]:
Pass stage-specific settings
The current generator recognizes these keys underwith:
| Key | What it controls |
|---|---|
base | Named base image context |
tags | Image tags for docker stages |
dockerfile | Override the chart Dockerfile path |
allow | BuildKit entitlements |
args | Build args passed into the chart |
Custom build arguments
You can define customARG values in chart Dockerfiles and pass values from build.yml through with.args.
Dockerfile example:
build.yml example:
Expand a stage with a matrix
Usetypes when every target of the same type should fan out across a matrix:
publish where:
- the same source target is reused
- the
runtimeaxis expands into one variant per value - the generated target name includes the matrix value
- the chart receives
RUNTIMEas a build arg
type: publish entry turns into two generated publish variants, one for win-x64 and one for win-arm64.
This is conceptually similar to:
The difference is that BuildCharts expands the matrix into Docker Buildx Bake targets instead of CI jobs. The matrix values become Bake target variants and build args that your chart Dockerfiles can consume.
Read more about Docker matrix targets.