You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/swift-container-plugin/Documentation.docc/authentication.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,3 +54,40 @@ machine ghcr.io
54
54
login mygithubusername
55
55
password ghp_fAOsWl...
56
56
```
57
+
58
+
### Amazon Elastic Container Registry
59
+
60
+
> Amazon Elastic Container Registry uses [short-lived authorization tokens](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html#registry-auth-token) which expire after 12 hours.
61
+
>
62
+
> To generate an ECR authentication token, you must [first install the AWS CLI tools.](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
63
+
64
+
1. Use the `aws` CLI tool to [generate an authentication token](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html#registry-auth-token).
65
+
You'll need to know the name of the [AWS region](https://docs.aws.amazon.com/global-infrastructure/latest/regions/aws-regions.html) in which your registry is hosted.
66
+
Registries in different AWS regions are separate and require different authentication tokens.
67
+
68
+
The following command generates a token which can be used with ECR in the `us-west-2` region:
69
+
```
70
+
aws ecr get-login-password --region us-west-2
71
+
```
72
+
73
+
2. Copy the token and add it to your `.netrc` file.
74
+
* The format of the machine name is:
75
+
76
+
```
77
+
<aws_account_id>.dkr.ecr.<region>.amazonaws.com
78
+
```
79
+
80
+
You can [find your AWS account ID](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-identifiers.html) in the AWS Management Console or by running the following command:
81
+
```
82
+
aws sts get-caller-identity \
83
+
--query Account \
84
+
--output text
85
+
```
86
+
* **The login name must be `AWS`**.
87
+
* The token is a large encoded string which is not shown in full in the example.
0 commit comments