2025-03-14 21:59:59 -06:00
|
|
|
# crane
|
|
|
|
|
|
|
|
|
|
> Container images managing tool.
|
|
|
|
|
> Some subcommands such as `pull`, `push`, `copy`, etc. have their own usage documentation.
|
|
|
|
|
> More information: <https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md/>.
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Log in to a registry:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`crane 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 the repos in a registry:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`crane catalog {{registry}} --full-ref`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- List the tags in a repository:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`crane ls {{repository}} {{[-o|--omit-digest-tags]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Pull remote images by reference and store their contents locally:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`crane pull {{image}} {{tarball}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Push local image contents to a remote registry:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`crane push {{path/to/directory_or_tarball}} {{image}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Efficiently tag a remote image:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`crane tag {{image}} {{tag}}`
|
|
|
|
|
|
|
|
|
|
- Efficiently copy a remote image from `src` to `dst` while retaining the digest value:
|
|
|
|
|
|
|
|
|
|
`crane copy src dst {{[-a|--all-tags]}}`
|
|
|
|
|
|
|
|
|
|
- Delete an image reference from its registry:
|
|
|
|
|
|
|
|
|
|
`crane delete {{image}}`
|