| by Arround The Web | No comments

How to Create a Private Repository in AWS

A repository is often known as a “repo” which actually is a collection of files and their history from its creation. It is basically a folder with sub-folders in it but with additional features like completely remembering all the versions of files with changes made to them. AWS allows the user to create these repositories on the cloud using the Elastic Container Registry service.

This guide will explain how to create a private repository in AWS.

Create a Private Repository Using AWS Console

To create a private repository using the AWS dashboard, visit the “Elastic Container Registry” or ECR dashboard:


Click on the “Repositories” page from the ECR dashboard:


Head into the “Private” section and click on the “Create repository” button:


Select the “Private” option from the visibility settings and type the name of the repository:


Scroll down the page and review the settings before clicking on the “Create repository” button:


The repository has been created successfully, head into it by clicking on its name:


Click on the “View push commands” button:


All the commands to use the repository will be provided by the platform:

Create a Private Repository Using AWS CLI Command

AWS allows the user to manage its resources from the AWS CLI commands and to create the repository using the following syntax:

aws ecr create-repository \
    --repository-name <Name of Repository> \
    --image-scanning-configuration scanOnPush=true \
    --region <region>

 
Here:

    • The above syntax uses “aws ecr” keywords which are the names of the platform and the service followed by the “create-repository” keyword suggesting the action to be performed.
    • Configure it by typing the name of the repository with image scanning configuration to be stated true and then provide the region.

Using the above syntax, the following command is being used to create a repository on the AWS account:

aws ecr create-repository --repository-name test_repository --image-scanning-configuration scanOnPush=true --region ap-southeast-1

 
Running the above command creates a repository in the AWS ECR service:


Verify the repository creation from the “Repositories” page on the “Elastic Container Registry” dashboard:


The repository has been created successfully:


That’s all about how to create a private repository in AWS.

Conclusion

To create a private repository in AWS a user can use the Management Console or AWS CLI commands. The Elastic Container Registry or ECR service is used to create a private repository in the AWS account. This guide has explained both the methods of creating a private repository in an AWS account using AWS ECR.

Share Button

Source: linuxhint.com

Leave a Reply