2024-10-03 11:48:34 +02:00
|
|
|
# crane mutate
|
|
|
|
|
|
|
|
> Modify image labels and annotations.
|
|
|
|
> The container must be pushed to a registry, and the manifest is updated there.
|
|
|
|
> More information: <https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane_mutate.md>.
|
|
|
|
|
|
|
|
- New annotations to set (default []):
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{[-a|--annotation]}}/{{[-l|--label]}} {{annotation/label}}`
|
2024-10-03 11:48:34 +02:00
|
|
|
|
|
|
|
- Path to tarball/command/entrypoint/environment variable/exposed-ports to append to image:
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{--append}}/{{--cmd}}/{{--entrypoint}}/{{[-e|--env]}}/{{--exposed-ports}} {{var1 var2 ...}}`
|
2024-10-03 11:48:34 +02:00
|
|
|
|
|
|
|
- Path to new tarball of resulting image:
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{[-o|--output]}} {{path/to/tarball}}`
|
2024-10-03 11:48:34 +02:00
|
|
|
|
|
|
|
- Repository in the form os/arch{{/variant}}{{:osversion}}{{,<platform>}} to push mutated image:
|
|
|
|
|
|
|
|
`crane mutate --set-platform {{platform_name}}`
|
|
|
|
|
|
|
|
- New tag reference to apply to mutated image:
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{[-t|--tag]}} {{tag_name}}`
|
2024-10-03 11:48:34 +02:00
|
|
|
|
|
|
|
- New user to set:
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{[-u|--user]}} {{username}}`
|
2024-10-03 11:48:34 +02:00
|
|
|
|
|
|
|
- New working dir to set:
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{[-w|--workdir]}} {{path/to/workdir}}`
|
2024-10-03 11:48:34 +02:00
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
2025-03-08 16:43:04 +02:00
|
|
|
`crane mutate {{[-h|--help]}}`
|