DevOps

AWS ECR: Creating and Managing Container Registries

Introduction

Today, we explore Amazon Elastic Container Registry (ECR), AWS's managed Docker registry. We'll create a repo and manage it.

Why ECR?

ECR stores Docker images securely, integrates with ECS, and handles authentication automatically.

Step 1: Create an ECR Repository

Via Console:

  1. Search for ECR in AWS Console.
  2. Click "Create repository."
  3. Choose private/public, name it (e.g., my-app-repo).
  4. Create.

Via CLI:

aws ecr create-repository --repository-name my-app-repo --region us-west-2

Step 2: Managing Repositories

  • Public vs. Private: Private for internal use; public for sharing.
  • Lifecycle Policies: To clean old images, add policy via console (e.g., expire untagged images after 30 days).
{
"rules": [
{
"rulePriority": 1,
"description": "Expire untagged images",
"selection": {
"tagStatus": "untagged",
"countType": "sinceImagePushed",
"countUnit": "days",
"countNumber": 30
},
"action": { "type": "expire" }
}
]
}

Verify: aws ecr describe-repositories

Ready to transform your business with our technology solutions? Contact Us  today to Leverage Our DevOps Expertise. 

Contact Us

0

Comment

159

Share

facebook
LinkedIn
Twitter
Mail
Devops

Related Center Of Excellence