github.com/hustcat/docker@v1.3.3-0.20160314103604-901c67a8eeab/man/docker-login.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-login - Log in to a Docker registry. 6 7 # SYNOPSIS 8 **docker login** 9 [**--help**] 10 [**-p**|**--password**[=*PASSWORD*]] 11 [**-u**|**--username**[=*USERNAME*]] 12 [SERVER] 13 14 # DESCRIPTION 15 Log in to a Docker Registry located on the specified 16 `SERVER`. You can specify a URL or a `hostname` for the `SERVER` value. If you 17 do not specify a `SERVER`, the command uses Docker's public registry located at 18 `https://registry-1.docker.io/` by default. To get a username/password for Docker's public registry, create an account on Docker Hub. 19 20 `docker login` requires user to use `sudo` or be `root`, except when: 21 22 1. connecting to a remote daemon, such as a `docker-machine` provisioned `docker engine`. 23 2. user is added to the `docker` group. This will impact the security of your system; the `docker` group is `root` equivalent. See [Docker Daemon Attack Surface](https://docs.docker.com/articles/security/#docker-daemon-attack-surface) for details. 24 25 You can log into any public or private repository for which you have 26 credentials. When you log in, the command stores encoded credentials in 27 `$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows. 28 29 > **Note**: When running `sudo docker login` credentials are saved in `/root/.docker/config.json`. 30 > 31 32 # OPTIONS 33 **--help** 34 Print usage statement 35 36 **-p**, **--password**="" 37 Password 38 39 **-u**, **--username**="" 40 Username 41 42 # EXAMPLES 43 44 ## Login to a registry on your localhost 45 46 # docker login localhost:8080 47 48 # See also 49 **docker-logout(1)** to log out from a Docker registry. 50 51 # HISTORY 52 April 2014, Originally compiled by William Henry (whenry at redhat dot com) 53 based on docker.com source material and internal work. 54 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 55 April 2015, updated by Mary Anthony for v2 <mary@docker.com> 56 November 2015, updated by Sally O'Malley <somalley@redhat.com>