--load and other cli flags regarding output behave different than expected
Contributing guidelines
- [x] I've read the contributing guidelines and wholeheartedly agree
I've found a bug and checked that ...
- [x] ... the documentation does not mention anything about my problem
- [x] ... there are no open or closed issues that are related to my problem
Description
docker buildx bake --help
--load Shorthand for "--set=*.output=type=docker"
The help would indicate that its just a shorthand and nothing magical is going on
Expected behaviour
It just a shorthand and nothing magical is going on
Actual behaviour
docker buildx bake --load --print
[+] Building 0.0s (1/1) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading docker-bake.hcl 59B / 59B 0.0s
{
"group": {
"default": {
"targets": [
"default"
]
}
},
"target": {
"default": {
"context": ".",
"dockerfile": "Dockerfile",
"output": [
{
"dest": "hi.tar",
"type": "tar"
}
]
}
}
}
It is not possible to override the ouptut using --load
docker buildx bake "--set=*.output=type=docker" --print
[+] Building 0.0s (1/1) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading docker-bake.hcl 59B / 59B 0.0s
{
"group": {
"default": {
"targets": [
"default"
]
}
},
"target": {
"default": {
"context": ".",
"dockerfile": "Dockerfile",
"output": [
{
"type": "docker"
}
]
}
}
}
Using the longhand syntax its suddenly possible.
If it is intended that --load cant override the values speciefied in the buildfile this should be clearly documented, because this is highly confusing. I think it would be preferable if --load would behave exactly the same as the --set syntax
Buildx version
github.com/docker/buildx v0.22.0-desktop.1 b45d7a53aa26a5e76aae051acdb15775c0e178da
Docker info
Builders list
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default docker
\_ default \_ default running v0.20.2 linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (2 more)
desktop-linux* docker
\_ desktop-linux \_ desktop-linux running v0.20.2 linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (2 more)
Configuration
target "default" { output= ["type=tar,dest=hi.tar"]
}
Build logs
Additional info
No response
Seems to be a regression since Buildx 0.14.0, I assume this is https://github.com/docker/buildx/pull/2336, specially this condition: https://github.com/docker/buildx/pull/2336/files#diff-fbe2fa23203f2ff05f06b6c0731ea90529f90906807483db76a79f6018781465R1460-R1464
I think this works as expected as local/tar outputs are not image outputs and it would be incorrect to try to load them. Docs can be improved.