Skip to content

Creating an Elastic Container Registry (ECR) Repository


ECR
For more information on ECR, visit https://aws.amazon.com/ecr/


ECR Repo Description


ECR is a managed Docker repository provided by AWS that allows users to store built Docker images that are accessible to various services withing the AWS ecosyste. This tutorial will walk through the steps required to create an ECR repository to store Docker images on AWS.


ECR Pre-Requisites


1.    Active AWS Account:
You will need to have an active AWS account, as this lab will cover setting up an AWS ECR Repository to store Docker Images on AWS.


Create ECR Repository


1.    Navigate to the ECS Console:
From the top left side of the navigational menu bar, click on the Services menu, and then choose Elastic Container Registry by either navigating to the Compute section of the listed services, or by typing the first few letters of the service name in the search box, and then choosing it from the filtered list.


ECR


2.    Click Getting Started:
If you have never used ECS or ECR previously, you will be presented with the Getting Started page. Click the Getting_Started button. On the Getting Started screen, Uncheck the Deploy a sample application onto an Amazon ECS Cluster leaving only the Store container images securely with Amazon ECR option checked, and then press Continue.


Getting Started


3.    Name the Registry:
Next we will need to name the registry. Type the name of your repository in the Repository Name field and then press Next step.


Name Repo


Repository Name:

Use only lower case letters and no special symbols in the container registry naming convention.


4.    View Repo Instructions:
Last we will be presented with the information on how to log in and interact with our repository. Read through the instructions, and press the Done button once done.


Retrieving Login Instructions:

If you need to see the instructions again in the future, you can do so by going to the registry in the ECR Repositories section of the console, selecting the repository, and clicking the View Push Commands button at the top of the repository view window.


Repository Info


5.    Verify Repo:
Once the repository has been completed, and you have hit done on the instructions page, you should now be able to see the new repository.


Repo View


Setting ECR Permissions


Now that we have created our repository, its time to set the permissions on the repository to allow any authentiated user to pull images from the repository.


1.    Navigate to the Repository Permissions Console:
From the ECR main console window, click on the repository, and the click on the Permissions tab. To add a new policy to the repository, simply click the Add button in the console view.


Permission Tab


2.    Add a New Permission Policy:
In the policy editor view, Name the policy Public or some arbitrary name, and then select Allow for the Effect, Select Everybody for the Principal, and finally select Pull only actions under the Action section. Once complete, click the Save all button to save the policy.


Create Policy


Save Policy


Ready for Push


Your new Docker ECR repository is now ready to be used for its first push... Simply go build your image, tag it appropriately according to the ECR repository address given when the repository was created, and push it to the new repository !!


ECR Additional Resources


No Additional Resources.


ECR Site/Information References


No Additional References.


Comments