Pushing a Docker Image to the EC2 Container Registry

Mohamed Labouardy
Oct 26, 2017 · 2 min read

In this quick post, I will show you how to setup a Docker Registry on AWS using EC2 Container Registry (ECR) service and how to push & pull an image from Amazon ECR.

1 — Configure Repository

First login to your AWS Management Console then navigate to ECR:

Click on “Get Started“:

Choose a name for your repository, then click on “Next“:

At this point, you will be taken to the Repositories Dashboard:

Congratulation ! you have created your first AWS Docker Registry.

In order to push & pull docker images from/to ECR, we need to get docker login from AWS CLI:

|eval $(aws ecr get-login — region us-east-1)

Issue the following command to tag the image with the repository URI:

|docker tag nginx 305929695733.dkr.ecr.us-east-1.amazonaws.com/nginx-custom

Run the following command to push it to the repository:

|docker push 305929695733.dkr.ecr.us-east-1.amazonaws.com/nginx-custom

Let’s check the repository:

HackerNoon.com

how hackers start their afternoons.

Mohamed Labouardy

Written by

Founder Komiser.io — Maker & Indie Entrepreneur, Senior Software Engineer/DevOps, Writer/Author and Speaker — Blog: https://labouardy.com

HackerNoon.com

how hackers start their afternoons.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade