Closed cavcrosby closed 10 months ago
When you run docker login registry-1.docker.io
the authentication details are put in your local credential store based on the key of the registry you are authenticating against. In this case, that is registry-1.docker.io
. Then, when you run docker pull cavcrosby/k8s101-hello-go
Docker engine looks up authentication details in the credential store based on the key http://index.docker.io
and there is nothing there, so it thinks you are not authenticated against Docker Hub.
I recommend that whatever registry you use in one docker
command should be used in all others.
e.g. docker login registry-1.docker.io
and docker pull registry-1.docker.io/cavcrosby/k8s101-hello-go
e.g. docker login
and docker pull cavcrosby/k8s101-hello-go
Either of these examples should work. As humans, we know those point to the same registry, Docker Hub Registry, but Docker engine doesn't understand that.
I appreciate the clarifications, this gives me a better idea of what's going then. I will now close this issue out because it seems this behavior is intended.
Problem description
docker login registry-1.docker.io
returns success when using a username and personal access token for the Docker Hub registry (orregistry-1.docker.io
). However, I am unable to pull any of my private images once successfully authenticated. For example, when I rundocker pull cavcrosby/k8s101-hello-go
I receive the following error:Error response from daemon: pull access denied for cavcrosby/k8s101-hello-go, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
.I don't appear to be the only one either who has run into this issue either, see https://github.com/docker/hub-feedback/issues/2285#issuecomment-1308979392. However, said individual from the linked issue reported getting things to work with a user(name) and password but in 2023 MFA/2FA is a no-brainer and I can't see myself turning it off.
That said, I managed to work around this issue by modifying the registry portion of my image to explicitly mention the Docker Hub registry. So the command now was
docker pull registry-1.docker.io/cavcrosby/k8s101-hello-go
. This worked, but it isn't something I would have expected to append considering I believe the Docker Hub registry is the default registry used for Docker images.Perhaps I'm just missing something here.
docker info
outputDocker Info:
Task List