Skip to content

Commit

Permalink
docs: Add note on using credHelpers for multi-registry authentication
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Raja Yogidas <[email protected]>
  • Loading branch information
coderbirju committed Dec 23, 2024
1 parent 08549e0 commit 14a5a71
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,6 @@ contents of your `~/.docker/config.json` file to be:
This configures the Docker daemon to use the credential helper for all Amazon
ECR registries.

The Amazon ECR Docker Credential Helper can be used alongside your existing docker login authentication tokens:

```json
{
"credsStore": "ecr-login",
"auths": {
"https://index.docker.io/v1/": {
"auth": [docker.io-auth-token]
},
"registry.gitlab.com": {
"auth": [gitlab-auth-token]
},
}
}
```

With Docker 1.13.0 or greater, you can configure Docker to use different
credential helpers for different ECR registries. To use this credential helper for
a specific ECR registry, create a `credHelpers` section with the URI of your
Expand All @@ -253,6 +237,26 @@ ECR registry:
This is useful if you use `docker` to operate on registries that use different
authentication credentials.

If you need to authenticate with multiple registries, including non-ECR registries, you can combine credHelpers with auths. For example:
```json
{
"credHelpers": {
"<aws_account_id>.dkr.ecr.<region>.amazonaws.com": "ecr-login"
},
"auths": {
"ghcr.io": {
"auth": [GITHUB_PERSONAL_ACCESS_TOKEN]
},
"https://index.docker.io/v1/": {
"auth": [docker.io-auth-token]
},
"registry.gitlab.com": {
"auth": [gitlab-auth-token]
}
}
}
```

### AWS credentials

The Amazon ECR Docker Credential Helper allows you to use AWS credentials stored in different locations. Standard ones
Expand Down

0 comments on commit 14a5a71

Please sign in to comment.