summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/build.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 18c31313b..0ff482cd9 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -240,14 +240,22 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
}
}
- pullPolicy := imagebuildah.PullNever
- if flags.Pull {
- pullPolicy = imagebuildah.PullIfMissing
+ pullPolicy := imagebuildah.PullIfNewer
+ if c.Flags().Changed("pull") {
+ if flags.Pull {
+ pullPolicy = imagebuildah.PullAlways
+ } else {
+ pullPolicy = imagebuildah.PullNever
+ }
}
if flags.PullAlways {
pullPolicy = imagebuildah.PullAlways
}
+ if flags.PullNever {
+ pullPolicy = imagebuildah.PullNever
+ }
+
args := make(map[string]string)
if c.Flag("build-arg").Changed {
for _, arg := range flags.BuildArg {