Published , Last updated
As a DevOps engineer at Appsolute Innovation, I've worked extensively with AWS services. One tool that has consistently proven invaluable is Amazon ECR (Elastic Container Registry) — a fully managed Docker container registry that simplifies storing, managing, and deploying container images. In this guide, I’ll walk you through what Amazon ECR is, why it’s useful, and how to get started.
Amazon Elastic Container Registry (ECR) is a managed Docker container registry service by AWS. It integrates seamlessly with Amazon ECS, EKS, and AWS Lambda, making it easy to store and retrieve container images securely.
Think of it like DockerHub, but within your AWS ecosystem — faster, more secure, and scalable.
Here’s why I recommend ECR for beginners and professionals alike:
Let me walk you through the basic steps I follow when setting up ECR repositories and pushing Docker images.
Before we start, make sure you have:
Run this to verify AWS CLI:
aws --version
Run this command to create a new repository:
aws ecr create-repository --repository-name my-app --region us-east-1
This will output your new repository's URI. Example:
123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app
Use this AWS CLI command to authenticate Docker:
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com
This step is essential — I’ve often seen developers stuck here due to expired credentials or region mismatches.
Build and tag your Docker image:
docker build -t my-app .
docker tag my-app:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
Then push to ECR:
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
From any machine (after authentication), you can pull the image:
docker pull 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
This is super useful for deployments on ECS, EKS, or even EC2 instances.
If you’re more comfortable with a visual interface, the AWS Console makes it simple to create and manage your ECR repositories. Here's how to do it step-by-step:
Now your repository is ready!
You’ll still need to use the CLI to authenticate Docker:
aws ecr get-login-password --region your-region | docker login --username AWS --password-stdin <your-repo-uri>
After authentication, follow the remaining steps from earlier (build, tag, push) using the CLI — even if you created the repository in the Console.
This helps you avoid bloating your storage with unused images.
You pay for the storage of your container images and data transfer. AWS offers 500MB of free storage per month per account, which is sufficient for testing and small apps.
We use ECR as part of our CI/CD pipeline. Every merge to the main branch triggers a GitHub Action that builds a Docker image, pushes it to ECR, and deploys it via ECS. This automation has saved hours of manual effort and improved deployment reliability.
Amazon ECR is an essential service for managing Docker images on AWS. Whether you're deploying microservices on ECS or building serverless apps with Lambda, ECR simplifies your container image management.
If you’re just getting started, I hope this guide helps you set up and use ECR with confidence.