Open
Description
I made a typo when writing a bake definition that contains an invalid targets
field for target
:
target "app" {
dockerfile = "app.Dockerfile"
}
target "db" {
dockerfile = "db.Dockerfile"
}
target "foo" {
targets = ["app", "db"]
}
What's wrong is the bake definition still looks valid:
$ docker buildx bake foo --print
{
"group": {
"default": {
"targets": [
"foo"
]
}
},
"target": {
"foo": {
"context": ".",
"dockerfile": "Dockerfile"
}
}
}
foo
should be a group
here:
target "app" {
dockerfile = "app.Dockerfile"
}
target "db" {
dockerfile = "db.Dockerfile"
}
group "foo" {
targets = ["app", "db"]
}
$ docker buildx bake foo --print
{
"group": {
"default": {
"targets": [
"foo"
]
},
"foo": {
"targets": [
"app",
"db"
]
}
},
"target": {
"app": {
"context": ".",
"dockerfile": "app.Dockerfile"
},
"db": {
"context": ".",
"dockerfile": "db.Dockerfile"
}
}
}
We should validate this.