gcrane-gc
Garbage collect unused container images in registry
TLDR
List untagged images
Whether to recurse through repositories
Display help
SYNOPSIS
gcrane gc --keep-days=
PARAMETERS
--keep-days=
Specifies the minimum age (in days) of images to be considered for deletion. Images older than this age are candidates for garbage collection.
--repository=
The Google Container Registry repository to garbage collect. For example, 'gcr.io/my-project/my-image'.
--project=
The Google Cloud project ID where the registry is located. If not specified, gcrane will attempt to infer it.
--token=
Authentication token to access GCR. Usually uses gcloud's credentials if not provided.
--dry-run
Performs a trial run without actually deleting any images. Prints a list of images that would be deleted.
--concurrency=
Number of goroutines to use for concurrent deletion. Useful for improving performance.
--include-tags=
Regular expression to match tags which should always be included (excluded from garbage collection).
--exclude-tags=
Regular expression to match tags to be excluded from garbage collection.
DESCRIPTION
The gcrane-gc command is a tool provided by Google for managing and cleaning up unused or obsolete images in Google Container Registry (GCR). GCR can accumulate a large number of images over time, leading to increased storage costs. gcrane-gc helps to identify and delete these unnecessary images based on various criteria, such as age, tags, and manifest lists.
This tool is particularly useful in automated CI/CD pipelines or other environments where frequent image builds and deployments occur. By automating the garbage collection process, it reduces storage overhead, improves resource utilization, and helps maintain a clean and efficient container registry. It is important to carefully configure and test the tool before running it in a production environment to avoid accidental deletion of important images. The tool typically relies on authentication using gcloud's credentials, or can be configured using service account keys.
CAVEATS
Always run gcrane-gc with the `--dry-run` option first to understand what images will be deleted. Carefully consider the `--keep-days` value to avoid deleting recently used or important images. Make sure that the tool has appropriate permissions to access and modify your GCR repository.
AUTHENTICATION
gcrane-gc typically uses the credentials configured by the gcloud command-line tool to authenticate with GCR. You may need to run 'gcloud auth login' and 'gcloud config set project
SEE ALSO
gcloud(1)