github.com/uriddle/docker@v0.0.0-20210926094723-4072e6aeb013/docs/reference/commandline/login.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "login"
     4  description = "The login command description and usage"
     5  keywords = ["registry, login, image"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # login
    12  
    13      Usage: docker login [OPTIONS] [SERVER]
    14  
    15      Register or log in to a Docker registry server, if no server is
    16  	specified "https://index.docker.io/v1/" is the default.
    17  
    18        -e, --email=""       Email
    19        --help               Print usage
    20        -p, --password=""    Password
    21        -u, --username=""    Username
    22  
    23  If you want to login to a self-hosted registry you can specify this by
    24  adding the server name.
    25  
    26      example:
    27      $ docker login localhost:8080
    28  
    29  
    30  `docker login` requires user to use `sudo` or be `root`, except when: 
    31  
    32  1.  connecting to a remote daemon, such as a `docker-machine` provisioned `docker engine`.
    33  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/security/security/#docker-daemon-attack-surface) for details. 
    34  
    35  You can log into any public or private repository for which you have
    36  credentials.  When you log in, the command stores encoded credentials in
    37  `$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows.
    38  
    39  > **Note**:  When running `sudo docker login` credentials are saved in `/root/.docker/config.json`.
    40  >