AWS ECR - Elastic Container Registry

·

2 min read

Amazon Elastic Container Registry (ECR) is a managed AWS Docker container registry service. It allows developers to store, manage, and deploy Docker container images. ECR is integrated with other AWS services such as Amazon Elastic Container Service (ECS), Amazon Elastic Kubernetes Service (EKS), and AWS Lambda, making it easier to deploy applications using these services.

Pushing Docker Image to ECR :

  1. Go to Aws console -> search ECR

  2. Select and create repository

    Visibility Settings :

    i) private - Can be accessed by IAM managed Users only.

    ii) public - Can be accesses by anyone in the world.

    Repository Name : Name of your repo

    Tag Immutability : When tag immutability is enabled, it prevents users from overwriting or deleting existing image tags within the repository.

  3. Select Image scan settings and Encryption settings based on your need.

    Image Scan Settings - Scan the docker images whenever they are pushed.

    Encryption Settings - AWS Key Management Service(KMS) can be used to encrypt the images if enabled.

  4. Repositories can be seen here,

  5. Open the repository.

    Since we haven't pushed any image into the repository, it will be empty.

  6. Select view push commands to push our image into repository.

  7. Before doing this, we need to configure our aws cli to add accesskeys. To get our accessKey. Go to security credentials ans generate access key there.

  8. Once configured, Enter the first command in terminal.

  9. I used vim to create Dockerfile

  10. Enter the second command Which is to build the image.

  11. Enter the third command which is to tag the image.

    1. Enter the fourth command to push the image to the repository.

    2. You can see the image in repository once the image is pushed successfully.

Conclusion :
In conclusion, Amazon Elastic Container Registry (ECR) is a managed AWS service that provides a secure and scalable repository for storing Docker container images. ECR is similar to Docker Hub but is integrated with other AWS services.

Did you find this article valuable?

Support Gopinath by becoming a sponsor. Any amount is appreciated!