← 返回命令列表

Linux command

crane-rebase 命令

文本

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

常用示例

Rebase an image onto a new base

crane rebase [image:tag] --old_base [old:base] --new_base [new:base] -t [rebased:tag]

Rebase for a specific platform

crane rebase [image:tag] --old_base [old:base] --new_base [new:base] --platform [linux/amd64]

说明

crane rebase replaces the base layers of an image with layers from a different base image. This is useful for updating base images without rebuilding, such as when a vulnerability is found in a base layer and many images need patching quickly. Rebasing should only be done at a point in the layer stack between "base" layers and "app" layers that adhere to a contract about what base layers produce.

参数

--old_base _image_
Old base image to remove.
--new_base _image_
New base image to insert.
-t, --tag _tag_
Tag to apply to the rebased image.
--platform _platform_
Platform in the form `os/arch/variant:osversion` (e.g., `linux/amd64`). Default is all.
--allow-nondistributable-artifacts
Allow pushing non-distributable (foreign) layers.
--insecure
Allow image references to be fetched without TLS.

FAQ

What is the crane-rebase command used for?

crane rebase replaces the base layers of an image with layers from a different base image. This is useful for updating base images without rebuilding, such as when a vulnerability is found in a base layer and many images need patching quickly. Rebasing should only be done at a point in the layer stack between "base" layers and "app" layers that adhere to a contract about what base layers produce.

How do I run a basic crane-rebase example?

Run `crane rebase [image:tag] --old_base [old:base] --new_base [new:base] -t [rebased:tag]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --old_base _image_ do in crane-rebase?

Old base image to remove.