Last active
September 12, 2022 07:59
-
-
Save kichiemon/4ba5bf921bc9e4d208db8723da69f0ed to your computer and use it in GitHub Desktop.
delete all images in container registry - see: https://stackoverflow.com/questions/67338215/cloud-function-build-error-failed-to-get-os-from-config-file-for-image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# e.g. CONTAINER_REGISTRY=asia.gcr.io/your-project-name/gcf/asia-northeast1 | |
CONTAINER_REGISTRY=`WRITE YOUR REGISTRY NAME` | |
IMAGE_LIST=`gcloud container images list --repository=$CONTAINER_REGISTRY | awk 'NR!=1'` | |
for line in $IMAGE_LIST; do | |
gcloud container images delete "$line/worker" --quiet & gcloud container images delete "$line/cache" --quiet & | |
done | |
wait |
Anyone knows where can I found the CONTAINER_REGISTRY name? :(
@EricBatlle Find the Container Registry in the cloud console for your project, then navigate the full path and you can copy-paste from the breadcrumb navigator :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could see there were many of the images tagged with the
latest
tag or with the name of my functions, but there were also a lot of untagged images in the same folders that I couldn't get rid of just by re-deploying with the latest firebase cli or using the script.So I ended up with this:
Hope it helps. Thanks @kichiemon.