- Name:
pack
Image Pull Policy - Start Date: 2020-05-21
- Author(s): Javier Romero
- Status: Implemented
- RFC Pull Request: rfcs#80
- CNB Pull Request: (leave blank)
- CNB Issue: (leave blank)
- Supersedes: N/A
Replace the flag --no-pull
with --pull-policy <option>
and introduce if-not-present
.
- Enable the use case where the user may locally create an alternative to an image that would otherwise be pulled without having to manually pull all other images if using
--no-pull
. - Provide support for an expected pull policy without polluting the number of flags available to commands.
- Allow for additional, potentially more complex pull policies such as
periodic=1d
orlifecycle=never,buildpack=always
A new flag --pull-policy
that takes the following possible options:
if-not-present
- only attempt to pull the images if it's not presentalways
- attempt to always pull imagesnever
- don't attempt to pull images
In the following commands, the images listed will adhere to the mentioned Pull Policy.
- Builder - Used as the build environment
- Buildpacks - When refered to in
--buildpacks
orproject.toml -> [[build.buildpacks]]
- Run (for stack) - Used as the base for the built app image
- Lifecycle - Used in cases where Builder is not trusted
- Builder - Used as the build environment
- Buildpacks - When refered to in
builder.toml
- Run (for stack) - Used as the base for the built app image
- Buildpacks - When refered to in
package.toml
For a period of time, --no-pull
flag will map to --pull-policy never
and print a deprecation warning.
- Longer CLI arguments (
--no-pull
->--pull-policy never
)- This might be a superfluous mention but does impact UX.
Instead of a single flag --pull-policy
with multiple options, we could add to our existing boolean flags such as:
--no-pull
: don't attempt to pull images--pull-missing
: only attempt to pull the images if it's not present--always-pull
: attempt to always pull images
- Discovery: harder to discover related flags
- Docker CLI:
docker build
works asif-not-present
with an additional flag that changes it toalways
(docker build --pull
). - Docker Compose:
docker-compose build
works asif-not-present
with an additional flag that changes it toalways
(docker-compose build --pull
). - Kubernetes:
The default pull policy is IfNotPresent which causes the Kubelet to skip pulling an image if it already exists
None