无法删除 GKE 中的本地注册表映像



对于 GKE 中显示的 docker 镜像列表,我正在尝试在 GKE 控制台中删除不需要的镜像,但出现错误。

如此链接中建议的 https://cloud.google.com/sdk/gcloud/reference/container/images/delete我正在尝试运行它,但出现错误。

例如,我正在尝试删除mynginx图像。

xxx@cloudshell:~ (involuted-ratio-227118)$ gcloud container images delete mynginx --force-delete-tags --quiet
ERROR: (gcloud.container.images.delete) [mynginx:latest] digest must be of the form "sha256:<digest>".
xxx@cloudshell:~ (involuted-ratio-227118)$ gcloud container images delete --quiet cs-6000-devshell-vm-37ed1cd7-726d-48bc-85df-8ce82c65f035/involuted-ratio-227118/mynginx@DIGEST
ERROR: (gcloud.container.images.delete) [cs-6000-devshell-vm-37ed1cd7-726d-48bc-85df-8ce82c65f035/involuted-ratio-227118/mynginx@DIGEST] digest must be of the form "sha256:<digest>".

任何帮助,不胜感激。谢谢

从文档中,

"要删除的图像的完全限定名称。名称应 格式为 *.gcr.io/PROJECT_ID/IMAGE_PATH@sha256:DIGEST 或 *.gcr.io/PROJECT_ID/IMAGE_PATH:TAG."

映像名称必须采用上述格式。此外,您需要将单词 DIGEST 替换为图像的 sha256 摘要。您可以使用类似命令获取摘要

docker images --digests | grep {IMAGE NAME}

其中 {图像名称} 是图像的名称。文档在这里。

最新更新