← 返回命令列表

Linux command

gcrane-gc 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Garbage collect untagged images

gcrane gc [gcr.io/project/repo]

Dry run

gcrane gc --dry-run [gcr.io/project/repo]

Garbage collect with grace period

gcrane gc --grace [24h] [gcr.io/project/repo]

说明

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.

参数

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

FAQ

What is the gcrane-gc command used for?

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.

How do I run a basic gcrane-gc example?

Run `gcrane gc [gcr.io/project/repo]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --dry-run do in gcrane-gc?

Show what would be deleted.