mirror of https://github.com/containers/podman.git
Merge pull request #20124 from vrothberg/build-docs
podman build: correct default pull policy
This commit is contained in:
commit
c59d1df75e
|
@ -65,11 +65,11 @@ func DefineBuildFlags(cmd *cobra.Command, buildOpts *BuildFlagsWrapper) {
|
|||
|
||||
// --pull flag
|
||||
flag := budFlags.Lookup("pull")
|
||||
if err := flag.Value.Set("true"); err != nil {
|
||||
logrus.Errorf("Unable to set --pull to true: %v", err)
|
||||
flag.DefValue = "missing"
|
||||
if err := flag.Value.Set("missing"); err != nil {
|
||||
logrus.Errorf("Unable to set --pull to 'missing': %v", err)
|
||||
}
|
||||
flag.DefValue = "true"
|
||||
flag.Usage = "Always attempt to pull the image (errors are fatal)"
|
||||
flag.Usage = `Pull image policy ("always/true"|"missing"|"never/false"|"newer")`
|
||||
flags.AddFlagSet(&budFlags)
|
||||
|
||||
// Add the completion functions
|
||||
|
|
|
@ -653,7 +653,7 @@ the help of emulation provided by packages like `qemu-user-static`.
|
|||
|
||||
#### **--pull**=*policy*
|
||||
|
||||
Pull image policy. The default is **always**.
|
||||
Pull image policy. The default is **missing**.
|
||||
|
||||
- **always**, **true**: Always pull the image and throw an error if the pull fails.
|
||||
- **missing**: Only pull the image when it does not exist in the local containers storage. Throw an error if no image is found and the pull fails.
|
||||
|
|
|
@ -24,6 +24,10 @@ EOF
|
|||
PODMAN_TIMEOUT=240 run_podman build -t build_test --format=docker $tmpdir
|
||||
is "$output" ".*COMMIT" "COMMIT seen in log"
|
||||
|
||||
# $IMAGE is preloaded, so we should never re-pull
|
||||
assert "$output" !~ "Trying to pull" "Default pull policy should be 'missing'"
|
||||
assert "$output" !~ "Writing manifest" "Default pull policy should be 'missing'"
|
||||
|
||||
run_podman run --rm build_test cat /$rand_filename
|
||||
is "$output" "$rand_content" "reading generated file in image"
|
||||
|
||||
|
|
Loading…
Reference in New Issue