What will happen after the maximum number of images pushed to ECR repository

耗尽温柔 提交于 2019-12-05 13:01:47

Having experienced this exact scenario, I can confirm that upon reaching the limit, AWS will block you from pushing with this very unhelpful error message:

Error pushing to registry: Server error: 403 trying to push <repo>:<label> manifest

You'll need to manage the number of repositories yourself. As there is currently no built in garbage collection (nor 'remove oldest') functionality, you have a few options:

  1. Remove the images via the console (which really is just woeful with so many images)
  2. Write your own tool that interfaces with the AWS CLI/SDK using the ecr batch-delete-image commands
  3. Request a limit to the maximum number you can store per repository. We've recently done this and was very easy to get the 1,000 limit increased to 5,000.

Another solution is to define ECR lifecycle policies. Here is a how-to guide: https://aws.amazon.com/blogs/compute/clean-up-your-container-images-with-amazon-ecr-lifecycle-policies/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!