Docker Community Forums

Share and learn in the Docker community.

"docker login" hangs with correct username/password

On my Ubuntu 18.04 system I can’t get docker login to work, either to our company’s private docker repository or to the default (docker’s own repository). I’m prompted for and enter my username, I’m prompted for and enter my password, then it hangs. If I misspell my username, or botch my password, I get an authentication error and it returns. If I type the username and password correctly, then it just hangs. So, it seems to be correctly authenticating, but then locks up.

Things I’ve tried:

  • docker login (with my free login username/password)

  • docker login (with my company username and password)

  • Updated Docker to the latest (Docker version 20.10.5, build 55c4c88)

  • Updated all the Ubuntu packages (staying on 18.0.4)

  • Left docker login hung for a half hour

  • Deleted ~/.docker (it doesn’t seem to be recreated when I run “docker login”)

  • sudo docker login (this time it does complete, but gives me a Error saving credentials: error storing credentials - err: exit status 1, out: 'Cannot autolaunch D-Bus without X11 $DISPLAY' error)

  • sudo docker run hello-world (runs and shows message saying your installation appears to be working correctly)

  • docker run -it ubuntu bash (downloaded Ubuntu image and left me at a bash prompt inside the container)

Any ideas? Is there a “verbose” option to docker login that will show me what’s going on behind the scenes?


Found the problem. This is a headless unit that I almost always ssh into, but if necessary I can VNC into it. I VNC’d into the desktop, and there was an authentication dialog open asking me to unlock the keychain. I did so, and now docker login works.

It would be great if the docker command had a ‘verbose’ option that showed what it was doing; when I found that it couldn’t store in the keychain I’d (hopefully) have been able to put two and two together much sooner.