Interview Prep/Docker/Registries, Tagging & Supply Chain

How do you enable immutable tags and lifecycle rules in ECR?

IntermediateProductionRegistries, Tagging & Supply Chain
Answer
aws ecr put-image-tag-mutability --repository-name app --image-tag-mutability IMMUTABLE
aws ecr put-lifecycle-policy --repository-name app --lifecycle-policy-text file://policy.json

A lifecycle policy example: keep last 30 images tagged v*, expire untagged images after 7 days. This controls storage cost and prevents accidental overwrites. Newer ECR supports exclusion patterns to keep some tags mutable.

All Docker questions Roadmap: Docker & containers

More on Registries, Tagging & Supply Chain