Skip to content

Conversation

@crazy-max
Copy link
Member

follow-up #881

If a target has the same name as a group, it's resolution is skipped.

group "foo" {
  targets = ["foo"]
}
target "foo" {
  dockerfile = "bar"
}
$ docker buildx bake foo --print
{
  "group": {
    "default": {
      "targets": [
        "foo"
      ]
    }
  },
  "target": {}
}

Now:

$ docker buildx bake foo --print
{
  "group": {
    "default": {
      "targets": [
        "foo"
      ]
    }
  },
  "target": {
    "foo": {
      "context": ".",
      "dockerfile": "bar"
    }
  }
}

@crazy-max crazy-max changed the title Fix bake resolution group bake: fix group resolution Dec 14, 2021
@crazy-max crazy-max requested a review from tonistiigi December 14, 2021 10:18

f := File{
Name: "docker-bake.hcl",
Data: []byte(`
Copy link
Contributor

Choose a reason for hiding this comment

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

I find JSON a bit nicer for these kind of tests, as you can indent each line as much as needed ;)

However, this test suite in particular has lots of strings with YAML, JSON & HCL... maybe a cleanup is due to move these assets to separate files.

@errordeveloper
Copy link
Contributor

I think the group and target functions seem a bit hard to read, maybe less ambiguous names could help, or perhaps these could be rewritten a little. Just an observation...

@tonistiigi tonistiigi merged commit fe9f9bb into docker:master Jan 4, 2022
@crazy-max crazy-max deleted the fix-bake-resgroup branch January 4, 2022 20:25
@crazy-max crazy-max added this to the v0.8.0 milestone Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants