Unable to push docker image to private repo in ECR.

0

When pushing to a private repo I'm getting an error:

docker push {acct id}.dkr.ecr.{region}.amazonaws.com/playwright:latest
The push refers to repository [{acct id}.dkr.ecr.{region}.amazonaws.com/playwright]
8c0977a15bc0: Layer already exists
8fbe1c855a6c: Pushed
e7234a7e0585: Pushed
b66a8735f383: Retrying in 1 second
a232236bb712: Pushed
8126a9472cb2: Pushing [======>                                            ]  212.7MB/1.57GB
755d11fc3fb7: Layer already exists
1606b10d8772: Pushing [===========================================>       ]  235.5MB/270.7MB
59c56aee1fb4: Retrying in 1 second
dialing {acct id}.dkr.ecr.{region}.amazonaws.com:443 with direct connection: resolving host {acct id}.dkr.ecr.{region}.amazonaws.com: lookup {acct id}.dkr.ecr.{region}.amazonaws.com: no such host

Any idea what it means? I'm able to login fine with below command:

aws ecr get-login-password --region {region} | docker login --username AWS --password-stdin {acct id}.dkr.ecr.{region}.amazonaws.com

I also have the permission: AmazonEC2ContainerRegistryFullAccess

quldude
已提问 9 个月前2070 查看次数
2 回答
1
已接受的回答
quldude
已回答 9 个月前
profile picture
专家
已审核 9 天前
profile picture
专家
已审核 1 个月前
0

he error message you're seeing, specifically the "no such host" part, indicates that the DNS resolution for the ECR endpoint is failing. This could happen for a variety of reasons, but here are some common troubleshooting steps you can follow:

  • Verify the ECR URL: Ensure that the URL for the ECR repository is correct. Double-check the account ID and region to make sure they are accurate.
  • Docker Daemon Restart: Sometimes restarting the Docker daemon can solve transient issues. You can do this with the following command:

sudo systemctl restart docker

  • AWS CLI Version: Ensure that you are using the latest version of the AWS CLI and Docker. Outdated versions might have compatibility issues.

  • Proxy Settings: If you are using a proxy, ensure that it's correctly configured to allow connections to the ECR endpoints.

  • Explicitly Specify the Protocol: You may try specifying the protocol (https) in the ECR URL. Like this:

docker push https://{acct id}.dkr.ecr.{region}.amazonaws.com/playwright:latest
  • Retry the Operation: Transient network errors can sometimes cause this issue. Simply retrying the push operation might resolve it.

  • Check System Logs: Sometimes, system logs can provide more detailed information about the underlying issue. You can check the Docker logs or system logs for more details.

profile picture
已回答 9 个月前
  • The ECR Url is correct. I'm using the push commands shown in the repo. How come some layers succeed and others dont?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则