How to push an image to ECR

Learn&Grow
2 min readSep 29, 2023

Firstly, create an ECR repository. Later you can build the container and push the image to the already created repository.

How to create an ECR Repository

Amazon Elastic Container Registry (ECR) is a fully managed Docker container registry service provided by Amazon Web Services (AWS). This service allows you to easily store, manage, and deploy Docker container images.

Login to the AWS account, Create an ECR Repository.

Ensure the registry is private, so that the repository images are safe.

You may:

  1. Enable Tag immutability
  2. Enable Scan on Push
  3. Encryption

Build and push Image to ECR

  • Authorize docker to push images to the ECR repository that we created
aws ecr get-login-password --region <region_name> | docker login --username AWS --password-stdin <ECR name>
  • Build your docker image
docker build -t <container_name>:<tag> .
docker tag <container_name>:<tag> <ECR>/<reponame>:<tag>
  • Push the image to the ECR
docker push <ECR>/<reponame>:<tag>
  • Once you push the image, the image tag must be visible in the ECR repo

Now the image is ready to be deployed.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Learn&Grow
Learn&Grow

Written by Learn&Grow

Technology Architect with profound understanding on the Multi-Cloud Platform engineering with a strong DevOps Solutioning Experience.

No responses yet

Write a response