bake: print default group#720
Conversation
884dead to
a61072f
Compare
|
I think the point of this should be that the resulting json is usable as a bake file. That means that for |
a61072f to
218c454
Compare
Ok, I changed the behavior to also print the default group if targets are specified.
I think it's ok even if combined but yes opt-out sgtm. // docker-bake.hcl
group "default" {
targets = ["image"]
}
target "image" {
inherits = ["image"]
output = ["type=docker"]
}# docker-compose.yaml
services:
addon:
build:
context: .
dockerfile: ./Dockerfile
args:
CT_ECR: foo
CT_TAG: bar
image: ct-addon:bar
environment:
- NODE_ENV=test
- AWS_ACCESS_KEY_ID=dummy
- AWS_SECRET_ACCESS_KEY=dummy
aws:
build:
dockerfile: ./aws.Dockerfile
args:
CT_ECR: foo
CT_TAG: bar
image: ct-fake-aws:bar$ docker buildx bake -f docker-compose.yml -f docker-bake.hcl --print
{
"group": {
"default": [
"image"
]
},
"target": {
"image": {
"context": ".",
"dockerfile": "Dockerfile",
"output": [
"type=docker"
]
}
}
}$ docker buildx bake -f docker-compose.yml -f docker-bake.hcl addon --print
{
"group": {
"default": [
"addon"
]
},
"target": {
"addon": {
"context": ".",
"dockerfile": "./Dockerfile",
"args": {
"CT_ECR": "foo",
"CT_TAG": "bar"
},
"tags": [
"ct-addon:bar"
]
}
}
}$ docker buildx bake -f docker-compose.yml -f docker-bake.hcl addon aws --print
{
"group": {
"default": [
"addon",
"aws"
]
},
"target": {
"addon": {
"context": ".",
"dockerfile": "./Dockerfile",
"args": {
"CT_ECR": "foo",
"CT_TAG": "bar"
},
"tags": [
"ct-addon:bar"
]
},
"aws": {
"context": ".",
"dockerfile": "./aws.Dockerfile",
"args": {
"CT_ECR": "foo",
"CT_TAG": "bar"
},
"tags": [
"ct-fake-aws:bar"
]
}
}
}$ docker buildx bake -f docker-compose.yml -f docker-bake.hcl addon aws image --print
{
"group": {
"default": [
"addon",
"aws",
"image"
]
},
"target": {
"addon": {
"context": ".",
"dockerfile": "./Dockerfile",
"args": {
"CT_ECR": "foo",
"CT_TAG": "bar"
},
"tags": [
"ct-addon:bar"
]
},
"aws": {
"context": ".",
"dockerfile": "./aws.Dockerfile",
"args": {
"CT_ECR": "foo",
"CT_TAG": "bar"
},
"tags": [
"ct-fake-aws:bar"
]
},
"image": {
"context": ".",
"dockerfile": "Dockerfile",
"output": [
"type=docker"
]
}
}
} |
Signed-off-by: CrazyMax <[email protected]>
218c454 to
c685e46
Compare
Fixes #183
Signed-off-by: CrazyMax [email protected]