We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The GCR of our integration testing project has accumulated thousands of images. I am cleaning them, but we will continue to accumulate them.
To list all the immediate "sub-repositories":
gcloud container images list --repository="gcr.io/${GCP_PROJECT}"
To delete all tags of a repository (not tested and may not work):
NAME="gcr.io/${GCP_PROJECT}/simpleimage" gcloud container images list-tags "${NAME}" --format='get(digest)' \ | sed -e "s,^,${NAME}@," \ | xargs gcloud container images delete --quiet --force-delete-tags
FTR:
#!/bin/sh GCP_PROJECT="${1:-jib-integration-testing}" delete_images() { echo "* Deleting images in ${1}..." local tags=$( gcloud container images list-tags "${1}" --format='get(digest)' \ | sed -e "s,^,${1}@," ) if [ -n "${tags}" ]; then gcloud container images delete --quiet --force-delete-tags $tags else echo "no tags to delete" fi } delete_repository() { local repositories=$( gcloud container images list --repository="${1}" ) for repo in ${repositories}; do if [ "${repo}" != "NAME" ]; then ( delete_repository "${repo}" ) delete_images "${repo}" fi done } delete_repository "gcr.io/${GCP_PROJECT}"
The text was updated successfully, but these errors were encountered:
@chanseokoh should we do some sort of weekly cron cleanup at 2am on sunday?
Sorry, something went wrong.
Yeah, we can do this. The question is, where to implement this cron. I've been doing this occasionally on my machine.
No branches or pull requests
The GCR of our integration testing project has accumulated thousands of images. I am cleaning them, but we will continue to accumulate them.
To list all the immediate "sub-repositories":
gcloud container images list --repository="gcr.io/${GCP_PROJECT}"
To delete all tags of a repository (not tested and may not work):
FTR:
The text was updated successfully, but these errors were encountered: