{
  "slug": "buildx-local-output-supports-mode-delete-a75ffebe67a5",
  "title": "buildx local output supports mode=delete",
  "tools": [
    "buildx"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-17T23:18:28.000Z",
  "announced_at": "2026-06-17T23:18:28.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "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.",
    "examples": [
      "docker buildx build --output type=local,dest=<output-dir>,mode=delete .",
      "docker buildx bake --allow=buildx.local.delete <target>"
    ],
    "gotchas": [
      "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+."
    ]
  },
  "why_it_matters": "When exporting a build or bake result to replace a destination directory, configure the local output to use delete mode.",
  "before": "The local output merged the build result into the destination directory.",
  "sources": [
    "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"
  ],
  "rank": 0.98037,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1-20261014",
    "verdict_id": "wave1-20261014:wave1-20261014-7d0b892140c60c3f-0:gate",
    "evidence_hash": "c8061b9eb10b3bf61a0c1409dcb2de439f76bd063c57ad90f3e16ae31002cf34"
  },
  "review": {
    "draft_hash": "9c6c4f3de482c4401fabebb759d7be7bfefb1ae9a9ec2c0ec4d0c3c0f0f003e8",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1-20261014:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.71 (>= 0.6 needed)."
  }
}
