mirror of
https://github.com/docker/login-action.git
synced 2025-04-20 18:16:45 +00:00
Get AccountID from registry URL and handle ECR registry through regexp
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
d3160f671f
commit
24646ef465
5 changed files with 122 additions and 34 deletions
|
@ -227,7 +227,7 @@ jobs:
|
|||
|
||||
### AWS Elastic Container Registry (ECR)
|
||||
|
||||
Use an IAM user with the [ability to push to ECR](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html).
|
||||
Use an IAM user with the ability to [push to ECR with `AmazonEC2ContainerRegistryPowerUser` managed policy for example](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html#AmazonEC2ContainerRegistryPowerUser).
|
||||
Then create and download access keys and save `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` [as secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
|
||||
in your GitHub repo.
|
||||
|
||||
|
@ -251,7 +251,7 @@ jobs:
|
|||
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
```
|
||||
|
||||
If you need to log in to Amazon ECR registries associated with other accounts, you can use the `AWS_ECR_REGISTRY_IDS`
|
||||
If you need to log in to Amazon ECR registries associated with other accounts, you can use the `AWS_ACCOUNT_IDS`
|
||||
environment variable:
|
||||
|
||||
```yaml
|
||||
|
@ -273,7 +273,7 @@ jobs:
|
|||
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
env:
|
||||
AWS_ECR_REGISTRY_IDS: "012345678910 023456789012"
|
||||
AWS_ACCOUNT_IDS: 012345678910,023456789012
|
||||
```
|
||||
|
||||
> Only available with [AWS CLI version 1](https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login.html)
|
||||
|
@ -310,7 +310,7 @@ jobs:
|
|||
|
||||
### AWS Public Elastic Container Registry (ECR)
|
||||
|
||||
Use an IAM user with the [ability to push to ECR](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html).
|
||||
Use an IAM user with the ability to [push to ECR Public with `AmazonElasticContainerRegistryPublicPowerUser` managed policy for example](https://docs.aws.amazon.com/AmazonECR/latest/public/public-ecr-managed-policies.html#AmazonElasticContainerRegistryPublicPowerUser).
|
||||
Then create and download access keys and save `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` [as secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
|
||||
in your GitHub repo.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue