Do not pull all available tags with --pull #100
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rocker --pull <image>
without a tag pulls all available tags for that image, and hence can fill the disk quickly.The reason is that the underlying
docker_client.pull(image,tag=None)
pulls all available tags if no specific tag is specfied:So the removed method
rocker.core.pull_image(image_name)
would have to decompose the URL given at the command line, and either pass the tag separately, or append:latest
toimage_name
if no other tag was specified.This patch removes the broken method completely. It is not needed, because the pull flag can simply be forwarded to the
docker_client.build()
command, at least for docker-py version 2.5.1 provided by Ubuntu Bionic and version 1.8.0 provided by Ubuntu Xenial.Verified with:
So the version tagged as
ubuntu:latest
is actuallyubuntu:bionic
.rocker
did not attempt to pull a newer version.--pull
still has the desired effect and the docker daemon pulls the image during the build:Without this patch, the second invocation
rocker --pull ubuntu
would take very long and pull all available tags.