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
docker pull
should prompt for login if pull fails and no current login
#7892
Comments
Due to the path that
Remove the "/images" portion of the URL:
I assume there are a few options--one is to take the 404 error path--only in the case where authConfig is empty--and retry without "/images" to check for a 401 and then ask for user auth, else just return the original 404. The other seems more heavy handed--if no authConfig (or empty, to be specific), then always try the repo base URI first to check for 401. This would slow the path to get public repo images for which auth would not be required anyway. I'm willing to help with this if someone wants to state a preference. Maybe another option is to poke at the nginx config around returning 401 on basic-auth URL paths--but that would require policing all kinds of repos that potentially already exist. |
maybe you should input your credentials after the "docker login" command, than use "docker pull" after being logged in. cheers. |
We retry the request without "/images" suffix on 404 in GetRepositoryData to see if the problem is lack of authorization, and if it is, we return a 401 instead of a 404. Fixes moby#7892. Signed-off-by: Donald Huang <don.hcd@gmail.com>
it prompts for credentials now afaik, but ping me if otherwise |
released version of 1.5 does not prompt for credentials if a pull fails. @jfrazelle
|
Problem
docker pull
on a private repository will fail with "Error: image XXXXXX/YYYYY not found" unless you're logged in with a user account that has access to the repo.If the user has never run
docker push
(which prompts for a login) then there may be no credentials in~/.dockercfg
and so thedocker pull
of the private repo fails with a misleading Error message (above).Proposed solutions
Either:
docker pull
orAnd:
If there are credentials, prompt with the Not Found error plus something like "Does account username have access to reponame?"
The text was updated successfully, but these errors were encountered: