Tuesday, April 9, 2019

Docker on Windows 10, how to fix "unauthorized: incorrect username or password" starting hello-world

Working on my Win10 laptop I've decided to switch from Virtualbox to Hyper-V , so I was also forced to change  my docker setup from Docker toolbox (legacy)  to  Docker for Windows.


After the change , when I was testing docker running the hello-workd I've got the following error:

C:\Users\mbisi>docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: unauthorized: incorrect username or password.
See 'docker run --help'.

Docker is storing the docker hub credential encrypted as referred in the following config file:

%USERPROFILE%/.docker/config.json



The easiest way to fix this issue is to perform a logout


C:\Users\mbisi>docker logout
Removing login credentials for https://index.docker.io/v1/

and a login from the hub:

C:\Users\mbisi>docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username:


that should fix the issue.

On the first try I tried to insert my username using the complete email address, but this cause a new authentication issue:

Username: myEmailAddress
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

If you are getting same error, try with the username should definitely fix this issue.The easiest way to find your docker hub username is logn to the  docker hub using a browser:


so I've retried:

C:\Users\mbisi>docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: mbisi
Password:
Login Succeeded

This fixed the original issue give me back the access to the docker hub.


A general recommendation if you have to switch from docker toolbox to docker for windows:
  1. uninstall docker toolbox
  2. check in the OS System environment and delete all docker_* variables
  3. check path variable and remove docker if present
  4. reboot the os, change the hypervisor 
  5. install docker for windows



No comments:

Post a Comment