NAME 名称

podman-search - Search a registry for an image
podman-search - 在镜像仓库中搜索镜像

SYNOPSIS 概要

podman search [options] term
podman search [选项] 关键词

DESCRIPTION 描述

podman search searches a registry or a list of registries for a matching image. The user can specify which registry to search by prefixing the registry in the search term (e.g., registry.fedoraproject.org/fedora). By default, all unqualified-search registries in containers-registries.conf(5) are used.
podman search 用于在镜像仓库或一组镜像仓库中搜索匹配的镜像。用户可以通过在搜索关键词中加上镜像仓库的前缀来指定要搜索的镜像仓库(例如,registry.fedoraproject.org/fedora)。默认情况下,将使用 containers-registries.conf(5) 中的所有未标记搜索的镜像仓库。

The default number of results is 25. The number of results can be limited using the --limit flag. If more than one registry is being searched, the limit is applied to each registry. The output can be filtered using the --filter flag. To get all available images in a registry without a specific search term, the user can just enter the registry name with a trailing “/” (example registry.fedoraproject.org/).
结果的默认数量为 25。可以使用--limit 标志来限制结果的数量。如果正在搜索多个注册表,则限制将应用于每个注册表。可以使用--filter 标志来过滤输出。要获取注册表中所有可用的镜像而不使用特定的搜索词,用户只需输入带有尾随“/”的注册表名称(例如 registry.fedoraproject.org/)。

Note that podman search is not a reliable way to determine the presence or existence of an image. The search behavior of the v1 and v2 Docker distribution API is specific to the implementation of each registry. Some registries may not support searching at all. Further note that searching without a search term only works for registries that implement the v2 API.
请注意,podman search 不是确定镜像是否存在的可靠方法。v1 和 v2 Docker 分发 API 的搜索行为特定于每个注册表的实现。某些注册表可能根本不支持搜索。进一步注意,没有搜索词的搜索仅适用于实现了 v2 API 的注册表。

podman [GLOBAL OPTIONS] podman [全局选项]

podman search [GLOBAL OPTIONS]
podman search [全局选项]

podman search [OPTIONS] TERM
podman 搜索 [选项] 术语

OPTIONS 选项

--authfile=path

Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json on Linux, and $HOME/.config/containers/auth.json on Windows/macOS. The file is created by podman login. If the authorization state is not found there, $HOME/.docker/config.json is checked, which is set using docker login.
认证文件的路径。在 Linux 上默认为 ${XDG_RUNTIME_DIR}/containers/auth.json ,在 Windows/macOS 上默认为 $HOME/.config/containers/auth.json 。该文件由 podman login 创建。如果授权状态未在那里找到,则会检查 $HOME/.docker/config.json ,该值是使用 docker login 设置的。

Note: There is also the option to override the default path of the authentication file by setting the REGISTRY_AUTH_FILE environment variable. This can be done with export REGISTRY_AUTH_FILE=path.
注意:还有一种选择,可以通过设置 REGISTRY_AUTH_FILE 环境变量来覆盖认证文件的默认路径。可以通过 export REGISTRY_AUTH_FILE=path 来实现。

--cert-dir=path

Use certificates at path (*.crt, *.cert, *.key) to connect to the registry. (Default: /etc/containers/certs.d) For details, see containers-certs.d(5). (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
使用证书路径(*.crt, *.cert, *.key)连接到注册表。 (默认值:/etc/containers/certs.d)有关详细信息,请参阅 containers-certs.d(5)。 (此选项不适用于远程 Podman 客户端,包括 Mac 和 Windows(不包括 WSL2)机器)

--compatible --兼容 ¶

After the name and the description, also show the stars, official and automated descriptors as Docker does. Podman does not show these descriptors by default since they are not supported by most public container registries.
在名称和描述之后,还显示星级、官方和自动化描述符,就像 Docker 一样。 Podman 默认情况下不显示这些描述符,因为大多数公共容器注册表不支持它们。

--creds=[username[:password]]
--creds=[用户名[:密码]] ¶

The [username[:password]] to use to authenticate with the registry, if required. If one or both values are not supplied, a command line prompt appears and the value can be entered. The password is entered without echo.
如果需要,用于与注册表进行身份验证的[用户名[:密码]]。如果一个或两个值未提供,将出现命令行提示,并可以输入该值。密码输入时不会显示。

Note that the specified credentials are only used to authenticate against target registries. They are not used for mirrors or when the registry gets rewritten (see containers-registries.conf(5)); to authenticate against those consider using a containers-auth.json(5) file.
请注意,指定的凭据仅用于对目标注册表进行身份验证。它们不用于镜像或注册表被重写时(请参阅 containers-registries.conf(5) );要对其进行身份验证,请考虑使用 containers-auth.json(5) 文件。

--filter, -f=filter --filter, -f=过滤器 ¶

Filter output based on conditions provided (default [])
根据提供的条件过滤输出(默认为[])

Supported filters are: 支持的过滤器包括:

  • stars (int) - minimum number of stars required for images to show
    stars(int)- 显示图片所需的最低星级数

  • is-automated (boolean - true | false) - is the image automated or not
    是否自动化(布尔值 - true | false)- 图像是否自动化

  • is-official (boolean - true | false) - is the image official or not
    是否官方(布尔值 - true | false)- 图像是否官方

--format=format

Change the output format to a Go template
将输出格式更改为 Go 模板

Valid placeholders for the Go template are listed below:
Go 模板的有效占位符如下所示:

Placeholder

Description

.Automated

“[OK]” if image is automated
如果图像是自动化的,则为“[OK]”

.Description

Image description 图像描述

.Index

Registry

.Name

Image name 图像名称

.Official

“[OK]” if image is official
如果镜像是官方的话则为“[OK]”

.Stars

Star count of image 镜像的星星数量

.Tag

Repository tag 仓库标签

Note: use .Tag only if the --list-tags is set.
注意:仅在设置了 --list-tags 时使用 .Tag。

--help, -h --help,-h ¶

Print usage statement 打印使用说明

--limit=limit

Limit the number of results (default 25). Note: The results from each registry is limited to this value. Example if limit is 10 and two registries are being searched, the total number of results is 20, 10 from each (if there are at least 10 matches in each). The order of the search results is the order in which the API endpoint returns the results.
限制结果数量(默认为 25)。注意:每个注册表的结果都限制在这个值。例如,如果限制为 10 并且正在搜索两个注册表,则总结果数为 20,每个注册表为 10(如果每个注册表至少有 10 个匹配项)。搜索结果的顺序是 API 端点返回结果的顺序。

--list-tags --列出标签 ¶

List the available tags in the repository for the specified image. Note: --list-tags requires the search term to be a fully specified image name. The result contains the Image name and its tag, one line for every tag associated with the image.
列出存储库中指定图像的可用标签。注意: --list-tags 要求搜索项为完全指定的图像名称。结果包含图像名称及其标签,每个标签关联的图像为一行。

--no-trunc

Do not truncate the output (default false).
不要截断输出(默认为 false)。

--tls-verify

Require HTTPS and verify certificates when contacting registries (default: true). If explicitly set to true, TLS verification is used. If set to false, TLS verification is not used. If not specified, TLS verification is used unless the target registry is listed as an insecure registry in containers-registries.conf(5)
在联系注册表时需要 HTTPS 并验证证书(默认值为 true)。如果显式设置为 true,则使用 TLS 验证。如果设置为 false,则不使用 TLS 验证。如果未指定,则除非目标注册表在 containers-registries.conf(5) 中被列为不安全注册表,否则将使用 TLS 验证。

EXAMPLES 示例

Search for images containing the specified name, returning the first three images from each defined registry.
搜索包含指定名称的图像,返回每个已定义注册表中的前三个图像。

$ podman search --limit 3 fedora
NAME                                     DESCRIPTION
NAME                                           DESCRIPTION
registry.fedoraproject.org/f29/fedora-toolbox
registry.fedoraproject.org/f30/fedora-toolbox
registry.fedoraproject.org/f31/fedora-toolbox
docker.io/library/fedora                       Official Docker builds of Fedora
docker.io/kasmweb/fedora-37-desktop            Fedora 37 desktop for Kasm Workspaces
docker.io/kasmweb/fedora-38-desktop            Fedora 38 desktop for Kasm Workspaces
quay.io/fedora/fedora
quay.io/containerdisks/fedora                  # Fedora Containerdisk Images  <img src="htt...
quay.io/fedora/fedora-minimal

Note that the Stars, Official and Automated descriptors are only available on Docker Hub and are hence not displayed by default.
请注意,星标、官方和自动化描述符仅在 Docker Hub 上可用,因此默认情况下不显示。

$ podman search --format "{{.Name}}\t{{.Stars}}\t{{.Official}}" alpine --limit 3
docker.io/library/alpine       7956        [OK]
docker.io/alpine/git           192
docker.io/anapsix/alpine-java  474
quay.io/libpod/alpine          0
quay.io/vqcomms/alpine-tools   0
quay.io/wire/alpine-deps       0

Search and list tags for the specified image returning the first four images from each defined registry.
搜索并列出指定镜像的标签,返回每个定义的仓库中的前四个镜像。

$ podman search --list-tags registry.access.redhat.com/ubi8 --limit 4
NAME                             TAG
registry.access.redhat.com/ubi8  8.4-211
registry.access.redhat.com/ubi8  8.4-206.1626828523-source
registry.access.redhat.com/ubi8  8.4-199
registry.access.redhat.com/ubi8  8.4-211-source

Note: This works only with registries that implement the v2 API. If tried with a v1 registry an error is returned.
注意:这仅适用于实现 v2 API 的仓库。如果尝试在 v1 仓库上使用,将返回错误。

FILES 文件 ¶

registries.conf (/etc/containers/registries.conf)

registries.conf is the configuration file which specifies which container registries is consulted when completing image names which do not include a registry or domain portion.
registries.conf 是配置文件,指定在完成不包括注册表或域部分的图像名称时要查询哪些容器注册表。

SEE ALSO 参见 ¶

podman(1), containers-registries(5)

HISTORY 历史 ¶

January 2018, Originally compiled by Urvashi Mohnani umohnani@redhat.com
2018 年 1 月,最初由 Urvashi Mohnani umohnani@redhat.com 编译