Skip to content

Commit

Permalink
podman build --build-arg should fall back to environment
Browse files Browse the repository at this point in the history
Fixes: #9571

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Mar 7, 2021
1 parent 2c500a8 commit 01ffe2c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/podman/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}
}
}
Expand Down

0 comments on commit 01ffe2c

Please sign in to comment.