Local exporter supports mode=delete for build results
Introduced 2026-06-17 · score 0.97
HOW TO USE IT
When exporting a build result to a local directory that should match the result, use `mode=delete` to remove destination files and directories absent from the result.
buildctl build ... --output type=local,dest=./bin/release,mode=deleteWHY THIS HELPS
Export a build result to a local directory that must match the result and remain confined to that destination if it is mutated during transfer.
BEFORE THIS CHANGE
Use the default `mode=copy`, which preserves existing destination files absent from the exported result.
REQUIREMENTS AND LIMITATIONS
- Version: v0.31.0
- type (required): Set to `local` for local directory output.
- dest (required): Destination directory for the local output.
- mode: `delete` removes destination files and directories absent from the result; `copy` is the default and preserves them. The documented values are alternatives.
- The default behavior remains mode=copy.
- For multi-platform local exports in delete mode, the complete export is sent as one filesystem; when platform splitting is enabled, a single platform-directory filesystem is built before streaming.
FIRST-PARTY EVIDENCE
- https://github.com/moby/buildkit/releases/tag/v0.31.0
- https://github.com/moby/buildkit/pull/6561
- https://github.com/moby/buildkit/blob/v0.31.0/README.md
Check the installed version and the source before using it. Entry JSON