diff options
Diffstat (limited to 'docs/reference/commandline/login.md')
| -rw-r--r-- | docs/reference/commandline/login.md | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/docs/reference/commandline/login.md b/docs/reference/commandline/login.md index a0f35fd4d0..e5d16567b2 100644 --- a/docs/reference/commandline/login.md +++ b/docs/reference/commandline/login.md @@ -27,12 +27,20 @@ Options: -u, --username string Username ``` +## Description + +Login to a registry. + +### Login to a self-hosted registry + If you want to login to a self-hosted registry you can specify this by adding the server name. - example: - $ docker login localhost:8080 +```bash +$ docker login localhost:8080 +``` +### Privileged user requirement `docker login` requires user to use `sudo` or be `root`, except when: @@ -43,7 +51,7 @@ You can log into any public or private repository for which you have credentials. When you log in, the command stores encoded credentials in `$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows. -## Credentials store +### Credentials store The Docker Engine can keep user credentials in an external credentials store, such as the native keychain of the operating system. Using an external store @@ -60,8 +68,6 @@ you can download them from: - Apple macOS keychain: https://github.com/docker/docker-credential-helpers/releases - Microsoft Windows Credential Manager: https://github.com/docker/docker-credential-helpers/releases -### Usage - You need to specify the credentials store in `$HOME/.docker/config.json` to tell the docker engine to use it: @@ -74,7 +80,7 @@ to tell the docker engine to use it: If you are currently logged in, run `docker logout` to remove the credentials from the file and run `docker login` again. -### Protocol +### Credential helper protocol Credential helpers can be any program or script that follows a very simple protocol. This protocol is heavily inspired by Git, but it differs in the information shared. @@ -120,3 +126,31 @@ an example of that payload: `https://index.docker.io/v1`. The `erase` command can write error messages to `STDOUT` that the docker engine will show if there was an issue. + +### Credential helpers + +Credential helpers are similar to the credential store above, but act as the +designated programs to handle credentials for *specific registries*. The default +credential store (`credsStore` or the config file itself) will not be used for +operations concerning credentials of the specified registries. + +### Logging out + +If you are currently logged in, run `docker logout` to remove +the credentials from the default store. + +Credential helpers are specified in a similar way to `credsStore`, but +allow for multiple helpers to be configured at a time. Keys specify the +registry domain, and values specify the suffix of the program to use +(i.e. everything after `docker-credential-`). +For example: + +```json +{ + "credHelpers": { + "registry.example.com": "registryhelper", + "awesomereg.example.org": "hip-star", + "unicorn.example.io": "vcbait" + } +} +``` |
