[proposal] implement pull-policies (docker build --pull=missing|never|always)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 682
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 29
Description
Pull request https://github.com/docker/cli/pull/1498 added a --pull option to docker run and docker create (to address https://github.com/moby/moby/issues/34394), which allows the pull-policy to be configured to use, and has three options:
--pull |
description |
|---|---|
| (not set) | (default) pull the image if it does not exist locally |
--pull=missing |
same as default above |
--pull=never |
don't pull the image, but produce an error if the image does not exist |
--pull=always |
always attempt to pull the image, even if the image exists locally: produce an error if pull failed |
docker build also has a --pull flag, but is implemented as a boolean:
--pull |
description |
|---|---|
| (not set) | (default) pull the image if it does not exist locally |
--pull=false |
same as above |
--pull / --pull=true |
always attempt to pull the image, even if the image exists locally: produce an error if pull failed. This is the equivalent of --pull=always on docker run |
Proposal
I think it would make sense to have docker build support the same options as docker run. For backward-compatibility, --pull would be the equivalent of --pull=always:
--pull |
description |
|---|---|
| (not set) | (default) pull the image if it does not exist locally |
--pull=missing |
same as default above |
--pull=never |
don't pull the image, but produce an error if the image does not exist |
--pull=always |
always attempt to pull the image, even if the image exists locally: produce an error if pull failed |
--pull |
equivalent to --pull=always. kept for backward compatibility |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing docker build --pull option and compare its behavior with the pull-policy handling already used by docker run and docker create. Implement the missing, never, and always values while preserving the existing --pull compatibility behavior; done means each documented policy produces the specified pull or error behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100