Unable to push docker image to ECR

0

While trying to push a docker image to a ECR repository, I get the following message:

The push refers to repository [<repository-location-and-name>] 5f56c5378ae9: Retrying in 1 second 6153a9b1f580: Retrying in 1 second a3f7911df18a: Retrying in 1 second 874448b54658: Retrying in 1 second 100796cdf3b1: Retrying in 1 second 54acb5a6fa0b: Retrying in 10 seconds 8d51c618126f: Retrying in 1 second 9ff6e4d46744: Retrying in 1 second a89d1d47b5a1: Retrying in 4 seconds 655ed1b7a428: Waiting EOF

And no further errors are displayed. From Stack Overflow answers, I figured it could be a permission problem. Then I went to AWS docs. for ECS, and found the following documentation: https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-push.html

Even after making the settings as per the documentation, I get the same result.

Could you please suggest what needs to be tweaked? It's kind of urgent.

Thanks much.

  • These are my 'Actions' settings in the policy statement:

    ecr-public:BatchCheckLayerAvailability ecr-public:CompleteLayerUpload ecr-public:InitiateLayerUpload ecr-public:PutImage ecr-public:UploadLayerPart

    Am I missing anything?

    Thanks.

rvenkat
asked 2 years ago14499 views
3 Answers
1

Have you tried this before build and push?

aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com
hai
answered 2 years ago
1

Is the repository public or private since the policy you have quoted above is for a public repository. If you have private repository, the policies should be ecr:xxx and not ecr-public:xxx

profile picture
Syd
answered 2 years ago
1

Thanks so much for the responses!

When I changed the region for the ECR and pushed the image, it worked! I am not sure why a region would make a difference.

Now I have my Image->ECR->ECS->Cluster up and running. Thanks!

rvenkat
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions