mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
podman build --build-arg should fall back to environment
Fixes: https://github.com/containers/podman/issues/9571 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -317,11 +317,16 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
|
|||||||
av := strings.SplitN(arg, "=", 2)
|
av := strings.SplitN(arg, "=", 2)
|
||||||
if len(av) > 1 {
|
if len(av) > 1 {
|
||||||
args[av[0]] = av[1]
|
args[av[0]] = av[1]
|
||||||
|
} else {
|
||||||
|
// check if the env is set in the local environment and use that value if it is
|
||||||
|
if val, present := os.LookupEnv(av[0]); present {
|
||||||
|
args[av[0]] = val
|
||||||
} else {
|
} else {
|
||||||
delete(args, av[0])
|
delete(args, av[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
flags.Layers = buildOpts.Layers
|
flags.Layers = buildOpts.Layers
|
||||||
|
|
||||||
// `buildah bud --layers=false` acts like `docker build --squash` does.
|
// `buildah bud --layers=false` acts like `docker build --squash` does.
|
||||||
|
Reference in New Issue
Block a user