Elastic Container Registry
On This Page
About
Amazon Elastic Container Registry (Amazon ECR) - Fully managed container registry offering high-performance hosting, so you can reliably deploy application images and artifacts anywhere
Hosted private Docker registry
Alternatives
- Docker Hub
- JFrog Artifactory
- Azure Container Registry
- Harbor
- Google Container Registry
- Red Hat Quay
- JFrog Container Registry
Price
Use Cases
Store, encrypt, and manage container images
- Manage software vulnerabilities
- Streamline your deployment workloads
- Manage image lifecycle policies
Type: Containers
Same type services: Elastic Container Service (ECS), Elastic Container Registry (ECR), Elastic Kubernetes Service (EKS), Fargate
Practice
This commands returns the command to execute to be able to login to ECR:
Login
- get-login-password:
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
- get-login-password:
Create a repository:
aws ecr create-repository \ --repository-name hello-repository \ --image-scanning-configuration scanOnPush=true \ --region region
Tag image
docker tag hello-world:latest aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository
Push
docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository
Pull
docker pull aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository:latest
Delete an image
aws ecr batch-delete-image \ --repository-name hello-repository \ --image-ids imageTag=latest \ --region region
Delete a repository
aws ecr delete-repository \ --repository-name hello-repository \ --force \ --region region
Labs:
- Use AWS Fargate for Serverless Deployment of Container Applications
- Quick start: Publishing to Amazon ECR Public using the AWS CLI
Notes:
- If you get a 503 Service Temporarily Unavailable error, try again after 30 seconds to let the load balancer finish adding the task to the target group.