-
Notifications
You must be signed in to change notification settings - Fork 573
Closed
Description
I am trying to only add tags if a variable is none empty, primarily fetching if the git commit has a version tag and if so i would like to push that tag. below is an example bake file demonstrating where i am at.
variable "TAG" {default="" }
group "default" {
targets = [
"app",
]
}
target "app" {
context="."
dockerfile="Dockerfile"
tags = [
"my-image:latest",
notequal("",TAG) ? "my-image:${TAG}": null,
]
}
null type is not allowed in arrays. An empty string will throw an error in the docker build. Not sure how to implement optional entries into an array. I also could not find a way to do appending with the tags assign.
wonder if it would be wiser to have empty strings be ignored for tagging to allow empty string results.
Metadata
Metadata
Assignees
Labels
No labels