bake: fix using push override with output definition#773
Merged
tonistiigi merged 1 commit intodocker:masterfrom Sep 22, 2021
Merged
bake: fix using push override with output definition#773tonistiigi merged 1 commit intodocker:masterfrom
tonistiigi merged 1 commit intodocker:masterfrom
Conversation
Signed-off-by: Tonis Tiigi <[email protected]>
crazy-max
approved these changes
Sep 21, 2021
Member
crazy-max
left a comment
There was a problem hiding this comment.
LGTM
I think the basis of this refactor can also be used to implement additional operators like
--set key+=valuein the future.
Wonder if we could also add this kind of logic in the HCL def like:
# docker-bake.hcl
target "webapp" {
dockerfile = "Dockerfile.webapp"
tags = ["username/webapp:latest"]
}# docker-bake2.hcl
target "webapp" {
extends {
tags = ["ghcr.io/username/webapp:latest"]
}
}
Member
Author
|
@crazy-max With referencing targets you could do |
|
I am also trying to merge tags, but I am getting the following error with this syntax. Any help would be appreciated (no rush though). target "webapp" {
tags = concat(target.baseimg.tags, ["ghcr.io/username/webapp:latest"])
}
ERROR: build-pipeline.hcl: Unknown variable; There is no variable named "target"., and 1 other diagnostic(s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, using
bake --pushwill replace the target definition withtype=registry. This means that if the definition defined an output then it gets cleared and completely overwritten.I think the basis of this refactor can also be used to implement additional operators like
--set key+=valuein the future.Signed-off-by: Tonis Tiigi [email protected]