compose: resolve build args from service environment

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-01-06 11:59:41 +01:00
parent 3400fa5628
commit 5d715ada96
2 changed files with 14 additions and 2 deletions

View File

@ -76,6 +76,9 @@ func ParseCompose(dt []byte) (*Config, error) {
Dockerfile: dockerfilePathP,
Labels: s.Build.Labels,
Args: flatten(s.Build.Args.Resolve(func(val string) (string, bool) {
if val, ok := s.Environment[val]; ok && val != nil {
return *val, true
}
val, ok := cfg.Environment[val]
return val, ok
})),