Hackernoon logoPushing a Docker Image to the EC2 Container Registry by@mlabouardy

Pushing a Docker Image to the EC2 Container Registry

Mohamed Labouardy Hacker Noon profile picture

Mohamed Labouardy

DevOps Engineer

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:

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.