How to push your image on AWS ECR

Posted on December 9, 2019

Find the image you want to push

docker images

Tag your image with the ECR registry (replace with your image-id, region name and choose name for your registry)

docker tag <image-id> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<my-app>

Finally. Push the image to the registry

docker push <aws_account_id>.dkr.ecr.region.amazonaws.com/<my-app>

 If you get this error

denied: Your Authorization Token has expired. Please run 'aws ecr get-login --no-include-email' to fetch a new one.

Run the command as suggested and then copy the output and run it as command (will look like docker login -u AWS -p XXXX........)

 

Sources:

https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html