Elastic Container Registry

Updated: 2023-09-01
2 min read

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

Elastic Container Registry Flow

Alternatives

  • Docker Hub
  • JFrog Artifactory
  • Azure Container Registry
  • Harbor
  • Google Container Registry
  • Red Hat Quay
  • JFrog Container Registry

Price

Current 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
  • 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:

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.