dockerdockerhub

How to login to Docker Hub on the command line?


I have read some Docker tutorials and I see this command line:

docker login -u LOGIN -p PASSWORD

But the registry server URL is never set. How does the docker command know the registry URL? What is the URL for Docker Hub Registry? I have tried this:

docker login -u LOGIN -p PASSWORD cloud.docker.com

but it does not work.


Solution

  • If you want to login to the default Docker Hub repository, simply use:

    docker login
    

    or more specifically:

    docker login registry-1.docker.io