buildx local output supports mode=delete
Introduced 2026-06-17 · score 0.98
HOW TO USE IT
When a build or bake local export should replace its destination, set `mode=delete`. For multi-platform exports, use BuildKit v0.31.0 or later; exporting outside a subdirectory of the working directory requires `--allow=buildx.local.delete` or TUI confirmation.
docker buildx build --output type=local,dest=<output-dir>,mode=delete .docker buildx bake --allow=buildx.local.delete <target>WHY THIS HELPS
When exporting a build or bake result to replace a destination directory, configure the local output to use delete mode.
BEFORE THIS CHANGE
The local output merged the build result into the destination directory.
REQUIREMENTS AND LIMITATIONS
- Version: v0.35.0
- --output / -o (required): Sets the export action; use `type=local` for a local directory export.
- dest (required): Destination directory for local export files.
- mode (required): Local output write mode: `copy` or `delete`; `delete` removes stale destination files after export. Values are alternatives, not combinable.
- --allow=buildx.local.delete: Allows delete mode when destination is the working directory or resolves outside it; Buildx docs say it is unnecessary for a destination subdirectory.
- Prerequisite: For multi-platform exports, BuildKit v0.31.0 or later is required.
- The destination directory must be a subdirectory of the working directory unless `--allow=buildx.local.delete` is provided or the action is confirmed in the TUI.
- Multi-platform exports require BuildKit v0.31.0+.
FIRST-PARTY EVIDENCE
- https://github.com/docker/buildx/releases/tag/v0.35.0
- https://docs.docker.com/reference/cli/docker/buildx/build/
- https://github.com/docker/buildx/blob/master/docs/bake-reference.md
Check the installed version and the source before using it. Entry JSON