Skip to content

Instantly share code, notes, and snippets.

@kichiemon
Last active September 12, 2022 07:59
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kichiemon/4ba5bf921bc9e4d208db8723da69f0ed to your computer and use it in GitHub Desktop.
Save kichiemon/4ba5bf921bc9e4d208db8723da69f0ed to your computer and use it in GitHub Desktop.
#!/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
@maganap
Copy link

maganap commented Jan 16, 2022

@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 :)
Screenshot 2022-01-16 at 20 33 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment