-
Notifications
You must be signed in to change notification settings - Fork 617
Open
Labels
Description
Description
Playing around with Docker Bake I found I needed to duplicate quite a bit of config as currently
#1203 is not yet supported. However, even with that feature implemented, it would
be nice to inherit config from a map like, for example:
function "mkTarget" {
params = [name]
result = {
tags = ["registry.example.com/${name}"]
cache-from = [
{
type = "registry"
ref = "registry.example.com/${name}:cache"
}
]
cache-to = [
{
type = "registry"
ref = "registry.example.com/${name}:cache"
}
]
}
}
target "default" {
inherits = [mkTarget("app")]
context = "something"
tags = ["registry.example.com/other:latest"]
}This probably shouldn't use the inherits field, but this is just to give a general idea. It should probably not be
possible to merge the contents of the inherits field in the map due to potential infinite loops.
I'd be happy to look into implementing this if this is something that would be useful.