How Do You Solve the Problem of the “docker login” Command Seeming to Work but Hanging for a Long Period of Time and/or Erroring out with “connection refused”?

Problem scenario
"docker login" is challenging you for a username and password.  But after you enter the credentials and press enter, it hangs.  You are not logging into the Docker registry.  What is wrong?

It may be surprising, but you can be challenged for a username and password when the Docker registry is turned off.  If a firewall blocks a necessary port to the Docker registry or if the Docker registry's server is off completely, you may get a slow response.  Eventually you may get "connection refused."  You may want to install nmap to test the relevant port.  You may want to verify the Docker registry server is turned on.

Leave a comment

Your email address will not be published. Required fields are marked *