[ECR] [request]: Lifecycle policy to cleanup old images that hasn't been pulled in a long time.
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
What do you want us to build?
Similar to the open request [here](https://github.com/aws/containers-roadmap/issues/1036), it would be welcomed to cleanup ECR repository images if they are not used by any container services (ECS, EKS, Fargate, etc). Because ECR can be used with various services it is currently impossible to check if the images are used and because the image can be pulled from any source, it is most likely not feasible for ECR to check if image is in use. A possible approach will be to introduce a "Last Pulled at" field or data to track when the image was last pulled and can be used in the ECR Image Lifecycle policy to perform image cleanup (currently only image age or image count are options).
**Which service(s) is this request for?**
ECR
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
In order to save on storage cost and maintain a "clean" repository, unused images should be removed. Currently image age and count on ECR Lifecycle policy helps clean up, but there is no way to determine if the image is still in use (i.e. pulled recently).
**Are you currently working around this issue?**
How are you currently solving this problem?
Using ECR Lifecycle policy with image age and count. Not really ideal....
**Additional context**
Anything else we should know?
**Attachments**
If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)
Contributor guide
Research direction
No repository files, tests, or implementation entry points are identified. Start by reviewing the ECR lifecycle policy behavior described here and the related request in issue #1036. Done would mean ECR can use an image's last-pulled data to remove images that have not been used for the specified period.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100