2025-03-14 21:59:59 -06:00
|
|
|
# gcrane
|
|
|
|
|
|
|
|
|
|
> Container images managing tool.
|
2025-12-16 10:20:31 -07:00
|
|
|
> This tool implements a superset of the `crane` commands, with additional commands that are specific to Google Container Registry (`gcr.io`).
|
2025-03-14 21:59:59 -06:00
|
|
|
> Some subcommands such as `append`, `auth`, `copy`, etc. have their own usage documentation which can be found under `crane`.
|
|
|
|
|
> Some subcommands such as `completion`, `gc`, `help` are specific to gcrane and have their own usage documentation.
|
|
|
|
|
> More information: <https://github.com/google/go-containerregistry/blob/main/cmd/gcrane/README.md>.
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Login to a registry:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gcrane auth login {{registry}} {{[-u|--username]}} {{user}} {{[-p|--password]}} {{password}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- List tags, manifests, and sub-repostiories:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gcrane ls {{registry}}/{{project_id}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Copy images from one registry to another:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gcrane cp {{[-r|--recursive]}} {{source_registry}}/{{project_id}}/{{repository}} {{target_registry}}/{{project_id}}/{{repository}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Print images that can be garbage collected:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gcrane gc {{registry}}/{{project_id}}/{{repository}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Delete images that can be garbage collected:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gcrane gc {{registry}}/{{project_id}}/{{repository}} | xargs {{[-n|--max-args]}} 1 gcrane delete`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- List a specific registry with specific ID:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gcrane ls {{gcr.io}}/{{my-project-id}}`
|
|
|
|
|
|
|
|
|
|
- Migrate all images from US registry to EU registry:
|
|
|
|
|
|
|
|
|
|
`gcrane cp {{[-r|--recursive]}} {{gcr.io}}/{{my-project-id}}/{{repository}} {{eu.gcr.io}}/{{my-project-id}}/{{repository}}`
|