Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Docker Tip #67: Incorrect Username or Password When Pulling Images

blog/cards/docker-tips-and-tricks.jpg

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!

Free Intro to Docker Email Course

Over 5 days you'll get 1 email per day that includes video and text from the premium Dive Into Docker course. By the end of the 5 days you'll have hands on experience using Docker to serve a website.



Comments