buildx
buildx copied to clipboard
Bake fails to push if any targets don't have tags
Currently we have some complex-ish logic about which tags apply to each target. In some cases a target may not need to be tagged at all.
When I bake --push, the whole thing fails immediately with error: tag is needed when pushing to registry
I think a better rule would be to show that error when no targets have tags? Or provide some way to do this kind of partial push
Reproducer:
group "default" {
targets = ["foo", "bar"]
}
target "foo" {
dockerfile-inline = "FROM php:5.6"
tags = []
}
target "bar" {
dockerfile-inline = "FROM php:5.6"
tags = ["myrepo/bar"]
}
I'd like that to complain that I don't own myrepo :)
I appreciate I could provide the target names to build, but I moved all the conditional logic into a function that generates the tags :)
Just checking in if this will be on the roadmap anytime soon? thanks 😄
+1 on this, perhaps another solution would be to add some kind of directive that indicates "this target does not need to be pushed"