Docker Tip #67: Incorrect Username or Password When Pulling Images
Using Docker to pull a public image should not require authentication but if your Docker Hub login credentials are bad it will fail.
If you run
docker image pull hello-world you should get a Hello World response, but if your Docker Hub credentials are incorrect then you’ll wind up getting this error:
Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: unauthorized: incorrect username or password
You can solve the above error by first running
docker logout which will remove your invalid credentials. At this point you should be able to pull any public Docker image from the Docker Hub without any further action.
Now you can login to the Docker Hub by running
docker login and when it asks for your username, use your Docker Hub username instead of your email address.
At this point it should log you in successfully and now you’ll be able to pull public / private images and also push images to your account. You’re good to go!