LinuxCommandLibrary

gcrane-gc

garbage collects untagged images

TLDR

Garbage collect untagged images

$ gcrane gc [gcr.io/project/repo]
copy
Dry run
$ gcrane gc --dry-run [gcr.io/project/repo]
copy
Garbage collect with grace period
$ gcrane gc --grace [24h] [gcr.io/project/repo]
copy

SYNOPSIS

gcrane gc [options] repository

DESCRIPTION

gcrane gc identifies untagged container images in Google Container Registry or Artifact Registry that are candidates for garbage collection. These orphaned images typically result from retagging or deleting tags, leaving unreferenced manifests that consume storage.
The command lists image digests that have no associated tags. It does not delete images directly; output should be piped to gcrane delete for actual removal. The grace period option protects recently created images from accidental deletion. Dry run mode shows what would be deleted without making changes, allowing safe preview before cleanup operations.

PARAMETERS

--dry-run

Show what would be deleted.
--grace duration
Keep images newer than duration.

SEE ALSO

gcrane(1), gcrane-ls(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community