ECS/ECR: is common practice to have one repository per image (and associated versions)?

Amazon Web-ServicesDockerAmazon EcsDocker RegistryAmazon Ecr

Amazon Web-Services Problem Overview


So I'm new to ecs/ecr, but it seems like I have to name (with a tag) the image after the repository name in order to push that image to the repository.

So my question is: Is it intended that the user (me) would ONLY be pushing a single image and any associated versions of that image to a single repository in ecr, thus creating ANOTHER repository if i need to push a completely different image?

basically, one repo for nginx, one repo for postgressql, etc.

Amazon Web-Services Solutions


Solution 1 - Amazon Web-Services

Yes. And also, possibly, no.

You push images to ECR. How you configure your image is up to you. Ideally, you'd have an image with a single responsibility, but this is your decision.

If you have multiple images, you push to multiple ECRs. If you have a single image doing many things, you can get away with a single ECR.

You can also push multiple images to the same ECR with creative use of tags (e.g. having the "image name or flavour" in the tag using your own naming convention.

Solution 2 - Amazon Web-Services

  1. It is recommended to push images with the version number of the same type.

> For example your-repo:1.1, your-repo:1.2

If you push images with the same that exist in the ECR repository than your old image will be replaced with the new image you are pushing.

  1. It depends on how your application is working. It is always advised to separate container working logically separate.

> For example The database image with a persistence volume. So, If a > database container dies than it would not affect your data.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaphexlogView Question on Stackoverflow
Solution 1 - Amazon Web-ServicesMrDukView Answer on Stackoverflow
Solution 2 - Amazon Web-ServicesmohitView Answer on Stackoverflow