문제 설명
GKE에서 로컬 레지스트리 이미지를 삭제할 수 없습니다. (Unable to delete local registry images in 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>".
어떤 도움이라도 주시면 감사하겠습니다. 감사합니다
참조 솔루션
방법 1:
From the documentation,
"The fully qualified name(s) of image(s) to delete. The name(s) should be formatted as *.gcr.io/PROJECT_ID/IMAGE_PATH@sha256:DIGEST or *.gcr.io/PROJECT_ID/IMAGE_PATH:TAG."
The image names must be in the above format. Also, you need to replace the word DIGEST with the image's sha256 digest. You can get the digest using command like
docker images ‑‑digests | grep {IMAGE NAME}
Where {IMAGE NAME} is the name of the image. Documentation here.