{
  "slug": "bake-var-sets-variables-from-the-command-line-b5b4b0587d6c",
  "title": "Bake --var sets variables from the command line",
  "tools": [
    "buildx"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-01-22T00:18:29.000Z",
  "announced_at": "2026-01-22T00:18:29.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a repository build needs Bake variable values supplied on the command line, run `docker buildx bake` with `--var name=value` and the target to build. This sets the variable without setting an environment variable.",
    "examples": [
      "docker buildx bake --var <name>=<value> <target>"
    ],
    "gotchas": [
      "Version: v0.31.0",
      "--var <name>=<value>: Sets a Bake variable value; the documented value format is `name=value`.",
      "<target>: Names a Bake target to build; the CLI also accepts no target argument.",
      "Prerequisite: Buildx must be installed to use `docker buildx bake`. The `--var` flag is available in Buildx v0.31.0.",
      "Prerequisite: The repository needs a Bake definition; Bake searches the current working directory for one when `--file` is omitted."
    ]
  },
  "why_it_matters": "Set Bake variable values for a repository build without setting environment variables.",
  "before": "Set variable values using environment variables.",
  "sources": [
    "https://github.com/docker/buildx/releases/tag/v0.31.0",
    "https://docs.docker.com/reference/cli/docker/buildx/bake/",
    "https://docs.docker.com/build/bake/introduction/",
    "https://docs.docker.com/build/bake/reference/"
  ],
  "rank": 0.98032,
  "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": "wave1b-20261016",
    "verdict_id": "wave1b-20261016:wave1b-20261016-f7712a60cc987a7c-2:gate",
    "evidence_hash": "c24a02b05121e6f5ea15a3e91f6081dbc961264a52cbc85ed092b08d62e7ec83"
  },
  "review": {
    "draft_hash": "4482ba9d5db5390274d43845278242ae97fafa2a22e09fcfa0330ef1b8c8df1f",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-20261016:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.61 (>= 0.6 needed)."
  }
}
