How to create an ECR Container Repository and push a Docker image?


ECR is a Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.


Create repository:

aws ecr create-repository --repository-name project/web-app

Delete repository:

aws ecr delete-repository --repository-name project/web-app



Docker needs to be logged into the registry. The aws client can output the required docker command to login with.

aws ecr get-login

Paste the output to login.

Push an image

First tag it with your ECR repository address:

docker tag myimage

Then push it:

docker push

List images

aws ecr list-images --repository-name project/web-app

Delete an image

aws ecr batch-delete-image --repository-name project/web-app --image-ids imageTag=latest