Why it matters
CI pipelines push new images on every build, so repositories grow steadily. Old images are rarely pulled again but are billed every month.How nOps finds it
nOps reads the daily storage of each repository over the last 90 days. A repository is flagged when it grew by at least 5%, never shrank by more than 3% on any day, and held at least 1 GB 90 days ago. Because nothing was deleted, the storage it already had 90 days ago is treated as images at least 90 days old. The saving is that share of the repository’s monthly cost, at your billed rate.Before you start
Know which image tags your services, deployments and rollback plans rely on.How to implement
- List the tags your services deploy from and any images you must keep for rollback or compliance.
- In the ECR console, open the repository and choose Lifecycle policy → Create rule.
- Add a rule that expires untagged images, and a rule that expires images older than 90 days while keeping the tags you deploy (for example, by tag prefix).
- Use Preview to see which images the policy would remove before saving it.
Risks and considerations
- Expired images are deleted permanently. Preview the policy and keep anything you might need to roll back to.
- Images share layers, so the real saving can be lower than the estimate when old images share layers with current ones.
FAQs
Why 90 days?
Why 90 days?
It is the window nOps measures. You can choose a longer or shorter age, or keep a set number of images instead.