Linux command
gcrane 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
List repositories and tags
gcrane ls [gcr.io/project-id]
List tags for a specific image
gcrane ls [gcr.io/project-id/image]
Copy an image
gcrane cp [gcr.io/project-id/image:tag] [gcr.io/other-project/image:tag]
Copy images recursively
gcrane cp -r [gcr.io/project-id/repo] [gcr.io/other-project/repo]
Find untagged images
gcrane gc [gcr.io/project-id/repo]
Delete untagged images
gcrane gc [gcr.io/project-id/repo] | xargs -n1 gcrane delete
Delete a specific image
gcrane delete [gcr.io/project-id/image@sha256:digest]
说明
gcrane is a Google Container Registry-specific variant of crane with enhanced features for GCR and Artifact Registry. It implements a superset of crane commands plus GCR-specific operations. Key enhancements over crane include recursive copying with -r flag (useful for backups, geo-replication, or mass renaming), detailed repository exploration with richer ls output, and the ability to identify untagged images for cleanup via the gc command. gcrane relies on GCR implementation details that may not be consistent with the general OCI registry specification.
参数
- -r
- Copy images recursively (for cp command).
- --platform _PLATFORM_
- Specify platform for multi-arch images.
- -v, --verbose
- Enable verbose output.
- -h, --help
- Display help information.
FAQ
What is the gcrane command used for?
gcrane is a Google Container Registry-specific variant of crane with enhanced features for GCR and Artifact Registry. It implements a superset of crane commands plus GCR-specific operations. Key enhancements over crane include recursive copying with -r flag (useful for backups, geo-replication, or mass renaming), detailed repository exploration with richer ls output, and the ability to identify untagged images for cleanup via the gc command. gcrane relies on GCR implementation details that may not be consistent with the general OCI registry specification.
How do I run a basic gcrane example?
Run `gcrane ls [gcr.io/project-id]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r do in gcrane?
Copy images recursively (for cp command).