Skip to main content
You can make one BuildCharts stage depend on another, even when the stages are implemented in different chart Dockerfiles. BuildCharts does this through Docker Buildx Bake target contexts. A context maps a name to either:
  • another Bake target (target:<name>)
  • an image (docker-image://...)
This is separate from chart dependencies in charts/buildcharts/Chart.yaml. For that, see Charts.

Use the default build stage context

For every generated target except build, BuildCharts wires a context named build to the build target:
contexts = {
  build = "target:build"
}
This allows chart Dockerfiles to use build as an upstream stage, for example:
FROM build AS pre-docker
This works because target:build refers to the generated Bake target named build. BuildCharts requires exactly one build target in build.yml, so this build context is stable and unambiguous.

Depend on other targets

This is currently not configurable in build.yml, but you can still do it with Bake overrides at execution time.
docker buildx bake --file .buildcharts/docker-bake.hcl docker --set docker.contexts.publish=target:publish
Last modified on March 15, 2026