IBM Cloud Container Registry:如何使用 CLI 删除一组(甚至所有)图像

IBM Cloud Container Registry: How to remove a group (or even all) of images using CLI

检查“ibmcloud cr images”我发现我在 IBM Cloud 容器注册表中有数百个旧图像。有没有办法全部删除,或者按日期删除?例如,超过一年的图像?

(一些 shell 脚本可能会做,当然...)

有多个选项可以一次性从 IBM Cloud Container Registry:

中删除多张图片
  • 转到 browser console,然后勾选列表上方的所有框,可选择取消选择单个图像,然后单击 删除图像
  • 使用命令行和 IBM Cloud CLI,您可以使用 ibmcloud cr image-prune-untagged (see here for syntax) 删除所有未明确标记的图像。
  • 首先,使用类似 ibmcloud cr image-list --format '{{.Repository}}@{{.Digest}}'list all images and only print the repository and digest. Use this templating syntax to filter on some properties to reduce the list. Then, use that output list as input for ibmcloud cr image-rm (syntax) 的东西。