Skip to content

Conversation

@crazy-max
Copy link
Member

No description provided.

>
> `--set` is a repeatable flag. For array fields such as `tags`, repeat `--set` to provide multiple values or use the `+=` operator to append without replacing.
> Array literal syntax like `--set target.tags=[a,b]` is not supported.
> The `platform` field is a special case. It also accepts a comma-separated list.
Copy link
Member Author

@crazy-max crazy-max Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform is actually not a special case:

# docker-bake.hcl
target "default" {}
$ docker buildx bake --set "*.platform=linux/amd64,linux/arm64" --print
{
  "group": {
    "default": {
      "targets": [
        "default"
      ]
    }
  },
  "target": {
    "default": {
      "context": ".",
      "dockerfile": "Dockerfile",
      "platforms": [
        "linux/amd64,linux/arm64"
      ]
    }
  }
}

It needs to be repeated:

$ docker buildx bake --set "*.platform=linux/amd64" --set "*.platform=linux/arm64" --print
{
  "group": {
    "default": {
      "targets": [
        "default"
      ]
    }
  },
  "target": {
    "default": {
      "context": ".",
      "dockerfile": "Dockerfile",
      "platforms": [
        "linux/amd64",
        "linux/arm64"
      ]
    }
  }
}

@crazy-max crazy-max marked this pull request as ready for review October 17, 2025 11:25
Copy link
Contributor

@aevesdocker aevesdocker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll get this updated in the docs repo as well

@tonistiigi tonistiigi merged commit b006e0f into docker:master Oct 22, 2025
41 checks passed
@crazy-max crazy-max deleted the doc-fix-bake-set branch October 22, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants