Search code examples
dockergoogle-cloud-platformgoogle-cloud-storagegoogle-cloud-rungoogle-container-registry

Docker image keeps reappearing in Container Registry and Cloud Storage


I followed a Cloud Run tutorial where I built a docker image and pushed it to Container Registry, which generated artifact layers in Cloud Storage. And when I finished, I deleted the layers from Storage, which in turn caused the image in Container Registry to be gone too.

But the thing is, now whenever I push a new image to Container Registry, in addition to the new image, the old image from the Cloud Run tutorial reappears in Cloud Registry as well as the old artifact layers in Cloud Storage.

I did not delete the Cloud Run service, which was built off of the old image(I didn't delete it since it does not charge when it is not in use). Is that why the old image & artifacts keep reappearing whenever I push a new image?

Can anybody help me understand what's going on and tell me how to delete the image and artifacts permanently?


Solution

  • On my understanding and as I just tested on Container Registry the older versions will not appear, It will only be adding the new image.

    On cloud Storage you will see that several new files appear (with the example you included 10) This files are the intermediate steps for the build, they are not old versions of the image, this files are the intermediate steps on the build for the new image.

    If what you want to do is to automatically delete the intermiadate steps on Cloud Storage and the image from Container Registry with cloudbuild you can create a custom build that does this.

    So the way descibed in here will delete the images in a permamnent way