paint-brush
Pushing a Docker Image to the EC2 Container Registryby@mlabouardy
18,390 reads
18,390 reads

Pushing a Docker Image to the EC2 Container Registry

by Mohamed LabouardyOctober 26th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Pushing a Docker Image to the EC2 Container Registry
Mohamed Labouardy HackerNoon profile picture

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: