Before you go, check out these stories!

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

Pushing a Docker Image to the EC2 Container Registry

Author profile picture

@mlabouardyMohamed Labouardy

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

Become a Hackolyte

Level up your reading game by joining Hacker Noon now!