Interview Prep/CI/CD/Build Tools and Artifact Repositories

How do you manage container image tags and retention in a registry?

AdvancedConceptBuild Tools and Artifact Repositories
Answer

Tag with the commit SHA (immutable) and optionally SemVer tags for releases. Enable tag immutability where supported (ECR imageTagMutability=IMMUTABLE). Use lifecycle policies to expire untagged and old images, for example keep the last 30 tagged images or anything younger than 90 days, but never delete images referenced by running deployments or production release tags. Scan on push and replicate critical images to a second region.

aws ecr put-image-tag-mutability --repository-name shop/api --image-tag-mutability IMMUTABLE
All CI/CD questions Roadmap: CI/CD fundamentals

More on Build Tools and Artifact Repositories