Open
Description
Description
I'd like to do the following:
Creating a common target and variables, affect it different keys like:
variable "IMAGE" {}
variable "TAG" {}
target "__common__" {
tags = [
"ghcr.io/OWNER/${IMAGE}:latest",
"ghcr.io/OWNER/${IMAGE}:${TAG}"
]
cache-to = [
{
type = "registry"
ref = "ghcr.io/OWNER/${IMAGE}:cache"
}
]
cache-from = [
{
type = "registry"
ref = "ghcr.io/OWNER/${IMAGE}:cache"
}
]
}
And then override it at the target level like this:
target "target-1" {
inherits = ["_common"]
context = "./docker"
dockerfile = "Dockerfile"
vars= {
image-name = "target-1"
}
}
I am not sure this feature exists, the current workaround might be to use a matrix strategy and no common target