← 返回命令列表

Linux command

crane-index-filter 命令

文本

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

常用示例

Filter an index to keep only linux/amd64

crane index filter [image] --platform linux/amd64

Filter to multiple platforms and tag the result

crane index filter [image] --platform linux/amd64 --platform linux/arm64 -t [registry/image:tag]

Filter with verbose output

crane index filter [image] --platform [linux/amd64] -v

Filter allowing insecure registries

crane index filter [image] --platform [linux/arm64] --insecure -t [registry/image:filtered]

说明

crane index filter modifies a remote multi-platform image index by removing platforms that do not match the specified --platform flags. The result is a new index containing only the selected architectures and OS combinations. This is useful for reducing the size of a multi-architecture image index, creating platform-specific distributions, or removing unwanted platforms before pushing to a registry. The --platform flag uses the format os/arch/variant:osversion, such as `linux/amd64`, `linux/arm64`, or `linux/arm/v7`.

参数

--platform _platform_
Platform(s) to keep in the form os/arch/variant:osversion. Can be specified multiple times.
-t, --tag _tag_
Tag to apply to the resulting filtered image.
--insecure
Allow image references to be fetched without TLS.
--allow-nondistributable-artifacts
Allow pushing non-distributable (foreign) layers.
-v, --verbose
Enable debug logs.
-h, --help
Show help for the filter command.

FAQ

What is the crane-index-filter command used for?

crane index filter modifies a remote multi-platform image index by removing platforms that do not match the specified --platform flags. The result is a new index containing only the selected architectures and OS combinations. This is useful for reducing the size of a multi-architecture image index, creating platform-specific distributions, or removing unwanted platforms before pushing to a registry. The --platform flag uses the format os/arch/variant:osversion, such as `linux/amd64`, `linux/arm64`, or `linux/arm/v7`.

How do I run a basic crane-index-filter example?

Run `crane index filter [image] --platform linux/amd64` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --platform _platform_ do in crane-index-filter?

Platform(s) to keep in the form os/arch/variant:osversion. Can be specified multiple times.