将最大数量的图像推送到ECR存储库后会发生什么 [英] What will happen after the maximum number of images pushed to ECR repository

查看:120
本文介绍了将最大数量的图像推送到ECR存储库后会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Amazon ECR服务限制,最大值每个存储库中的图像数量为1,000.超过此限制后,最旧的图像将不会自动删除.它阻止推送到存储库.因此,我必须手动清理旧图像.

According to Amazon ECR Service Limits, the maximum number of images per repository is 1,000. After exceeding this limit, the oldest image won't remove automatically. It blocks pushing to the repository. So I have to clean old images manually.

更新:AWS引入了

Update: AWS introduced ECR Lifecycle Policies. We can now automate the cleanup with this.

推荐答案

经历了这种确切的情况后,我可以确认,达到极限后,AWS将阻止您使用此非常无用的错误消息进行推送:

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. 通过控制台删除图像(对于这么多图像来说确实很糟糕)
  2. 编写您自己的工具,该工具使用ecr batch-delete-image命令与AWS CLI/SDK连接
  3. 请求限制每个存储库可以存储的最大数量.我们最近已经做到了,很容易将1,000个限额提高到5,000个.
  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.

这篇关于将最大数量的图像推送到ECR存储库后会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆