Is it possible to remove a pushed image from Google Container Registry?
I mean without handling the Google Cloud Storage directory directly.
Thanks!
Is it possible to remove a pushed image from Google Container Registry?
I mean without handling the Google Cloud Storage directory directly.
Thanks!
As explained here you can delete an image from Google Container Registry with the following gcloud command:
With current UI and its implementation, you can only delete tags, the underlying images will not be deleted.
If it is a Docker V2 images, from command line you can delete the image using Docker Registry API , by deleting the tags first, and then deleting the manifest. More about this at the end of the reply.
If it is a Docker V1 image, there is no "docker" way to delete the image, but you can delete the image in GCS.
We are implementing new features that will enable you to delete V2 tags and images.
Details about deleting V2 images/tags from command line using Docker Registry V2 API:
I opened a ticket with Google for this same question and they responded back that it is not possible currently but to stay tuned because they do plan on adding it to the UI shortly.
In the meantime you have to use the storage browser to delete any that you want removed.
Check how to delete images here.
Using CLI
gcloud container images delete [HOSTNAME]/[PROJECT-ID]/[IMAGE]
https://cloud.google.com/container-registry/docs/managing#deleting_images
Now that Google Container Registry migrated to v2, you can:
Remove manifests which will actually remove files and free space in your storage (use for example the Google Cloud Shell):
Note: It'll not delete manifest that are used by tags.
Note 2: Once Docker Registry upgrades to v2.1.1 one may call
GET /v2/_catalog
to list all images and run the above on all images to simplify the process.Update
Google Cloud Web UI allows now to delete images (see https://stackoverflow.com/a/33791574/167897)