Skip to main content
Charts can export artifacts by writing files into /output inside the Dockerfile. The generated Bake plan then uses a local output to copy that content to .buildcharts/output/<type> on the host during docker buildx bake.

Output behavior by stage type

Stage typeOutput behavior
buildtype=cacheonly
dockertype=docker
Any other typeExport to .buildcharts/output/<type>
That means test, nuget, and any custom non-docker type export local files under .buildcharts/output.

How local exports work

BuildCharts implements local outputs using Docker Buildx Bake build artifact exports. For any non-build and non-docker stage type, the generated docker-bake.hcl includes a local output like:
output = [
  "type=cacheonly,mode=max",
  "type=local,dest=.buildcharts/output/nuget"
]
type=local exports the filesystem contents of the target stage to a local directory. That means everything that exists in the final stage is copied to .buildcharts/output/<type>. This is why charts that export artifacts typically use a final FROM scratch stage and copy only the artifacts into it, for example:
FROM scratch AS nuget
COPY --from=pre-nuget /output /
For the underlying Docker pattern, see Exporting build artifacts.

Work with Docker outputs

docker stages use type=docker, so the image is loaded into your Docker environment instead of being exported to .buildcharts/output/docker. Use tags in build.yml so the result is easy to reference:
targets:
  src/App/App.csproj:
    - type: docker
      with:
        base: mcr.microsoft.com/dotnet/runtime:10.0
        tags: ["docker.io/example/app:${VERSION}-${COMMIT}"]
Last modified on March 15, 2026