build: add pull flag to force image pulling#9281
Conversation
|
I need to update this to modify the API docs. |
|
So much cleaner and simpler than |
Signed-off-by: Cristian Staretu <[email protected]>
ceea5b0 to
054e57a
Compare
There was a problem hiding this comment.
Why is this needed? I think we could always set it and we would be ok right?
There was a problem hiding this comment.
This is needed to make sure we don't change older API versions. This is similar to the checks for the --rm and --force-rm flags.
There was a problem hiding this comment.
But these old versions don't have this flag right?
There was a problem hiding this comment.
Yes, they don't have it and that's the reason why we're making sure we don't allow it for older versions.
|
API and doc changes have been made. |
|
LGTM |
1 similar comment
|
LGTM |
build: add pull flag to force image pulling
It is important to keep Docker images up-to date, as upstream images could have important security fixes, even using the same tag and version. When building images, it is possible to pass in a `--pull` flag to check if the base image has updates, and rebuild as necessary. This feature is available since 2014, and will still retain the image cache if there are no updates on the base image. [since 2014]: moby/moby#9281
|
Hello, Is there a way to use this --pull flag via docker-compose? Something like this? |
This PR adds a flag to
docker build.docker build --pull .will force the pulling of the image, even if it exists locally.Force pulling the image will update the existing local image if there's one.