Pushing a Docker Image to the EC2 Container Registry

Written by mlabouardy | Published 2017/10/26
Tech Story Tags: docker | aws | containers | docker-image

TLDRvia the TL;DR App

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:


Published by HackerNoon on 2017/10/26