Amazon Elastic Container Registry (ECR) is a fully managed container image registry by AWS.
It allows you to store, manage, and share Docker container images securely, just like Docker Hub, but inside AWS.
🔒 Secure Storage → Integrated with AWS IAM for access control
⚡ High Availability → Fully managed, scalable storage for images
🛠️ Integration → Works with ECS, EKS, and Fargate seamlessly
🔄 Lifecycle Policies → Automatically clean up unused images
📦 Supports OCI (Open Container Initiative) image format
🌍 Global Access → Push & pull images from anywhere via AWS CLI or SDK
👨💻 Developer builds a Docker image locally
🔑 Authenticate to ECR using AWS CLI
📤 Push image to ECR repository
📥 ECS / Fargate / EKS pulls image during deployment
🚀 Run containerized app in AWS
Create Repository → A place to store images
Build Image → docker build -t myapp .
Authenticate to ECR → aws ecr get-login-password
Tag Image → docker tag myapp:latest <aws_account_id>.dkr.ecr.<region>.amazonaws.com/myapp:latest
Push Image → docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/myapp:latest
Deploy → ECS / Fargate / EKS pulls the image
Feature | Docker Hub 🐳 | Amazon ECR ☁️ |
---|---|---|
Hosting | Public/Private | Private (with AWS security) |
Integration | Works with all platforms | Best with AWS ECS/EKS/Fargate |
Authentication | Docker login | AWS IAM authentication |
Cost | Free/Paid tiers | Pay for storage & data transfer |
Security | Basic | Strong AWS IAM + Encryption |
Think of ECR as a private warehouse for your containers 📦:
Docker Image = Product 🛍️
ECR = Warehouse 🏢
Push = Sending product to warehouse 🚚
Pull = Taking product from warehouse for delivery 📦
ECS/Fargate/EKS = Delivery services 🚀