Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request to add arguments --check and -q to docker pull command #41390

Open
Alessar opened this issue Aug 26, 2020 · 4 comments
Open

Feature request to add arguments --check and -q to docker pull command #41390

Alessar opened this issue Aug 26, 2020 · 4 comments
Labels
area/distribution kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@Alessar
Copy link

Alessar commented Aug 26, 2020

docker pull command allows download imagename:tagname from registry.
It will be good if there is argument (for example) --check that allows checking imagename:tagname in a registry (and checks that it can be downloaded if it is needed to provide authentication for example) but without downloading.
So, as a result, it is expected to see some info about imagename:tagname image if it can be downloaded or error in other cases.

It will be good if there is an argument -q (as in other commands) that allows printing only small info (for example) only tagname.

@thaJeztah thaJeztah added area/distribution kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny labels Aug 27, 2020
@thaJeztah
Copy link
Member

Possibly docker could just do a HEAD request for the image / image-manifest, which should require the same authentication as performing a pull. However, performing a docker pull without having access to an image should already provide the same (as in: if you don't have access, the pull would fail and be terminated);

docker pull thajeztah/private-test-image
Using default tag: latest
Error response from daemon: pull access denied for thajeztah/private-test-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Could you perhaps describe your use-case a bit more?

@Alessar
Copy link
Author

Alessar commented Aug 31, 2020

At first --check can divide authentication issue (when no permission on resource and we need run docker login command) and case when there is no specified tag on the image. In another case, we try to check the existing tag on the image and command docker pull downloads this image, but we need only check existence without downloading.

At second, we can run for example docker pull --all-tags alpine and we download all images from that repo. It is expected, that --check option can prevent downloading all tags and command only shows tags that can be downloaded from repo. For example it will show images, tags, digest, size (maybe some other info).

And of course -q options shows only minimal information from the table from --check option (for example only tag) like in commands docker ps -q or docker images -q.

@cpuguy83 cpuguy83 added this to To do in 21.x Planning Sep 4, 2020
@kbolino
Copy link

kbolino commented Nov 17, 2020

I've got a use case. Now that pull rate limits have been implemented, and they affect only and exactly GET of the manifest, having an option that does HEAD (which isn't rate limited) instead would be very useful, and this request seems pretty close to that.

@thaJeztah
Copy link
Member

@kbolino docker 20.10 will cache manifests, and perform a HEAD request on pull to check if the image manifest is up to date before pulling (see #41607)

However, the HEAD requests are not yet part of the distribution specification (see opencontainers/distribution-spec#207 and opencontainers/distribution-spec#208), so currently can only be used as an optimisation for some registries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/distribution kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
21.x Planning
  
To do
Development

No branches or pull requests

4 participants