[英]Push image to ECR works for private repositories only
I'm trying to push an image to a public repository in ECR.我正在尝试将图像推送到 ECR 中的公共存储库。 To be able to do so, I created a policy that gives push permissions and attached this policy to my user.为了能够这样做,我创建了一个提供推送权限的策略并将该策略附加到我的用户。 The policy in JSON format is the following: JSON格式的策略如下:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:*"
],
"Resource": "arn:aws:ecr:us-east-1:*:repository/my-app"
},
{
"Effect": "Allow",
"Action": [
"ecr:*"
],
"Resource": "arn:aws:ecr:us-east-1:*:repository/my-app-public"
},
{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken"
],
"Resource": "*"
}
]
}
The push works fine for the private repository but gives the error denied: Not Authorized
when I try to push the image to the public repo.推送对于私有存储库工作正常,但在我尝试将图像推送到公共存储库时出现错误denied: Not Authorized
。 How can I push an image to an ECR public repo?如何将图像推送到 ECR 公共存储库?
ECR Public is its own service (with its own ecr-public:*
actions). ECR Public 是它自己的服务(有它自己的ecr-public:*
动作)。 To push images to ECR Public, a set of ecr-public actions is needed in the statement.要将图像推送到 ECR Public,声明中需要一组 ecr-public 操作。
The first example here should get you on the right track: https://docs.aws.amazon.com/AmazonECR/latest/public/public-repository-policy-examples.html这里的第一个例子应该让你走上正轨: https://docs.aws.amazon.com/AmazonECR/latest/public/public-repository-policy-examples.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.