无法将Docker容器推送到Amazon ECR

时间:2018-07-05 11:50:30

标签: amazon-web-services docker amazon-ec2 docker-compose

我拍了张照片

111111111111.dkr.ecr.us-east-1.amazonaws.com/edx-cluster

我试图将其推送到亚马逊,但始终收到相同的错误。但是我可以将它推送到Docker中心而不会出现任何错误

docker push 111111111111.dkr.ecr.us-east-1.amazonaws.com/edx-cluster:latest
The push refers to repository [111111111111.dkr.ecr.us-east-1.amazonaws.com/edx-cluster]
ae0062a2d077: Preparing 
c52921d94e3e: Preparing 
aa5d8376b8c4: Preparing 
79a57fc7fbcc: Preparing 
8a1159c97df8: Preparing 
adb2c7b88404: Waiting 
d3a701e27209: Waiting 
d8d26a0d0d6c: Waiting 
a34d1923f571: Waiting 
9fd1fd063a37: Waiting 
397415b17275: Waiting 
25bb34378fc3: Waiting 
711cc8b6546f: Waiting 
8d733d8c32ff: Waiting 
69ce838fa634: Waiting 
e252a759abc0: Waiting 
26b126eb8632: Waiting 
220d34b5f6c9: Waiting 
8a5132998025: Waiting 
aca233ed29c3: Waiting 
e5d2f035d7a4: Waiting 
unauthorized: authentication required

但是我的AWS Ecr链接和auth密钥存在于dokcer配置文件auth块中,该块是在我致电aws ecr get-login之后生成的 我做错了什么?

1 个答案:

答案 0 :(得分:1)

尝试通过登录

aws ecr get-login --no-include-email --region <region>

您将获得该命令的docker登录副本并执行

docker login -u AWS -p 'long key' https://xxx.dkr.ecr.<region>.amazonaws.com

您将获得并输出

  

登录成功