diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 78cf4efd01..97eb966b7d 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -318,7 +318,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil if len(av) > 1 { args[av[0]] = av[1] } else { - delete(args, av[0]) + // 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 { + delete(args, av[0]) + } } } }