Trying to familiarize myself with ECR - i understand that you should be able to push as many repositories as you like to Docker registry.
However, ECR has a concept of a 'repository'. So if i have 10 different containers comprising my app, does it mean i need 10 repositories in a registry?
Can i have one repository and push 10 different containers with their 'latest' tags?
Currently if i tag another image with the same {registry}/{repository_name} pattern, it replaces latest
tag on my other image:
A registry can be hosted publicly or privately -- like a repository -- or by a third party. However, the important distinction between a registry and repository is that a registry is a collection of repositories, while repositories hold a collection of related images.
Container Registry is a single place for your team to manage Docker images, perform vulnerability analysis, and decide who can access what with fine-grained access control. Existing CI/CD integrations let you set up fully automated Docker pipelines to get fast feedback.
A Docker registry is a storage and distribution system for named Docker images. The same image might have multiple different versions, identified by their tags. A Docker registry is organized into Docker repositories , where a repository holds all the versions of a specific image.
If you want to get the detailed descriptions, I would check out the What Is Amazon EC2 Container Registry? page, which describes the components in detail, but the high level difference between the two is this: Each account has a Registry, each Registry can contain several repositories. Each Repository can contain several Images. An image can have Several Tags, a Tag can only exist once per Repository.
If you look at the reference to a repository:
[account].dkr.ecr.[region].amazonaws.com/[repository_name]
The part in front of the first /
is your registry, the part after the first /
is your repository.
So what you're experiencing here is that by pushing a second image to the same repository, you're changing the reference that the latest
tag is pointing to.
If you want to have multiple distinct images, each with their own latest
tag, each one should have it's own Repository. Based on the Pricing for ECR, you only pay based on the storage size and transfer from an ECR Repo, so there's little benefit to not creating additional repos.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With