Bobcares

AWS ECR Create Repository | Easy Methods

by | Jun 5, 2023

Let’s look at the steps to create an AWS ECR repository. At Bobcares, with our AWS Support Services, we can handle your ECR Repository issues.

Want to learn more? Read on and reach out to us if you have any further questions.

How To Create AWS ECR Repository?

Amazon ECR: Amazon ECR repositories house the container images, Open Container Initiative (OCI) images, and OCI compatible artefacts. We can simply create the AWS ECR Repository using any of the following methods:

aws ecr create repository
Method 1: Using AWS Management Console
  1. Firstly, access the Amazon ECR console.
  2. Then select the Region to create the repository in from the navigation bar.
  3. Now choose Repositories in the navigation pane.
  4. Select the Private tab from the Repositories page and then select Create repository.
  5. Also, make sure Private is chosen under Visibility settings.
  6. Now enter a unique name for the repository in the Repository name field. The name of the repository must begin with a letter and can only contain lowercase letters, numerals, hyphens, underscores, and forward slashes. It is not possible to use a double hyphen, underscore, or forward slash.
  7. Then select the repository’s tag mutability setting for tag immutability. Immutable tags in repositories prevent image tags from being overwritten.
  8. While we can specify scan settings at the repository level for basic scanning, it is best practise to specify scan configuration at the private registry level for Scan on Push.
  9. For KMS encryption, choose whether to enable encryption of the images in the repository using AWS Key Management Service.
  10. Now select Customer encryption settings (advanced) when KMS encryption is enabled to choose our own KMS key.
  11. Then select Create repository.
  12. Finally, select the newly formed repository and then click View push commands to see the processes for pushing an image to the new repository (Optional step).
Method 2: Using AWS CLI

Synopsis

create-repository
[--registry-id ]
--repository-name 
[--tags ]
[--image-tag-mutability ]
[--image-scanning-configuration ]
[--encryption-configuration ]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton ]

We must make sure the AWS CLI installed and configured to create the ECR repository with AWS CLI. For instance, consider the below examples.

aws ecr create-repository \
    --repository-name sample-repo \

In the above example,the code creates a new repository with name sample-repo. We can replace the “sample-repo” to the our repository name.

aws ecr create-repository \
    --repository-name sample-repo \
    --image-tag-mutability IMMUTABLE

The above example creates a repository configured with image tag immutability. We can replace the “sample-repo” to the our repository name.

[Need help with another query? We can assist you 24/7.]

Conclusion

In the Repositories section of the Amazon ECR console, we may create, monitor, and delete image repositories. Amazon ECR also integrates with the Docker CLI, so that we push and pull images from the development environments to the repositories. In this article, our Support team shows as two methods to create AWS ECR Repository, including some examples.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.