NAME 名称

podman-images - List images in local storage
podman-images - 列出本地存储中的镜像

SYNOPSIS 概要

podman images [options] [image]
podman images [选项] [镜像]

podman image list [options] [image]
podman image list [选项] [镜像]

podman image ls [options] [image]
podman image ls [选项] [镜像]

DESCRIPTION 描述

Displays locally stored images, their names, and their IDs.
显示本地存储的镜像、它们的名称和它们的 ID。

OPTIONS 选项

--all, -a

Show all images (by default filter out the intermediate image layers). The default is false.
显示所有镜像(默认情况下过滤掉中间镜像层)。默认值为 false。

--digests --摘要 ¶

Show image digests 显示镜像摘要

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

Provide filter values. 提供过滤器值。

The filters argument format is of key=value or key!=value. If there is more than one filter, then pass multiple OPTIONS: --filter foo=bar --filter bif=baz.
过滤器参数格式为 key=valuekey!=value 。如果有多个过滤器,则传递多个选项:--filter foo=bar --filter bif=baz。

Supported filters: 支持的过滤器:

Filter

Description

id

Filter by image ID. 按图像 ID 过滤。

before

Filter by images created before the given IMAGE (name or tag).
按照给定的图像(名称或标签)创建时间之前的图像进行过滤。

containers

Filter by images with a running container.
按照具有正在运行容器的图像进行过滤。

dangling

Filter by dangling (unused) images.
按悬空(未使用)图像筛选。

digest

Filter by digest. 按摘要筛选。

intermediate

Filter by images that are dangling and have no children
按悬空且没有子级的图像筛选。

label

Filter by images with (or without, in the case of label!=[…] is used) the specified labels.
使用指定标签筛选带有(或不带有,在使用 label!=[…]的情况下)图像。

manifest

Filter by images that are manifest lists.
按照清单筛选图像。

readonly

Filter by read-only or read/write images.
按照只读或读写图像筛选。

reference

Filter by image name. 按图像名称筛选。

after/since 之后/自从

Filter by images created after the given IMAGE (name or tag).
按照给定图像(名称或标签)创建的图像进行筛选。

until

Filter by images created until the given duration or time.
根据给定的持续时间或时间筛选创建的图像。

The id filter accepts the image ID string.
id 过滤器接受图像 ID 字符串。

The before filter accepts formats: <image-name>[:<tag>], <image id> or <image@digest>.
before 过滤器接受格式: <image-name>[:<tag>]<image id><image@digest>

The containers filter shows images that have a running container based on that image.
containers 过滤器显示基于该镜像运行容器的图像。

The dangling filter shows images that are taking up disk space and serve no purpose. Dangling image is a file system layer that was used in a previous build of an image and is no longer referenced by any image. They are denoted with the <none> tag, consume disk space and serve no active purpose.
dangling 过滤器显示占用磁盘空间且没有任何作用的图像。悬空图像是在以前构建镜像时使用的文件系统层,不再被任何图像引用。它们用 <none> 标记表示,占用磁盘空间且没有任何实际作用。

The digest filter accepts the image digest string.
digest 过滤器接受图像摘要字符串。

The intermediate filter shows images that are dangling and have no children.
intermediate 过滤器显示没有子级且悬空的图像。

The label filter accepts two formats. One is the label=key or label=key=value, which shows images with the specified labels. The other format is the label!=key or label!=key=value, which shows images without the specified labels.
label 过滤器接受两种格式。一种是 label =key 或 label =key=value,显示具有指定标签的图像。另一种格式是 label! =key 或 label! =key=value,显示不具有指定标签的图像。

The manifest filter shows images that are manifest lists.
manifest 过滤器显示清单列表中的图像。

The readonly filter shows, as a default, both read-only and read/write images. Read-only images can be configured by modifying the additionalimagestores in the /etc/containers/storage.conf file.
readonly 过滤器默认显示只读和读写图像。只读图像可以通过修改 /etc/containers/storage.conf 文件中的 additionalimagestores 进行配置。

The reference filter accepts the pattern of an image reference <image-name>[:<tag>].
reference 过滤器接受图像引用的模式 <image-name>[:<tag>]

The after or since filter accepts formats: <image-name>[:<tag>], <image id> or <image@digest>.
aftersince 过滤器接受格式: <image-name>[:<tag>]<image id><image@digest>

The until filter accepts formats: golang duration, RFC3339 time, or a Unix timestamp and shows all images that are created until that time.
until 过滤器接受格式:golang 时长、RFC3339 时间或 Unix 时间戳,并显示直到该时间创建的所有图像。

--format=format

Change the default output format. This can be of a supported type like ‘json’ or a Go template. Valid placeholders for the Go template are listed below:
更改默认输出格式。这可以是支持的类型,如'json'或 Go 模板。Go 模板的有效占位符如下所示:

Placeholder

Description

.Containers

Number of containers using this image
使用此图像的容器数量

.Created

Elapsed time since the image was created
图像创建后经过的时间

.CreatedAt

Time when the image was created, YYYY-MM-DD HH:MM:SS +nnnn
图像创建时间,YYYY-MM-DD HH:MM:SS +nnnn

.CreatedSince

Same as .Created 与 .Created 相同

.CreatedTime

Same as .CreatedAt 与 .CreatedAt 相同

.Dangling

Same as .IsDangling 与.IsDangling 相同

.Digest

Image digest 镜像摘要

.History

History of the image layer
镜像层的历史

.ID

Image ID (truncated) 图像 ID(已截断)

.Id

Image ID (full SHA) 图像 ID(完整 SHA)

.IsDangling

Is image dangling? (true/false)
图像是否悬空?(是/否)

.IsReadOnly

Is unage read-only? (true/false)
是否为只读?(是/否)

.Labels … .标签 …

map[] of labels 标签的 map[]

.Names

Image FQIN 镜像 FQIN

.ParentId

Full SHA of parent image ID, or null (string)
父镜像 ID 的完整 SHA,或 null(字符串)

.ReadOnly

Same as .IsReadOnly 与 .IsReadOnly 相同

.RepoDigests

map[] of zero or more repo/name@sha256:SHA strings
零个或多个 repo/name@sha256:SHA 字符串的 map[]

.Repository

Image repository 图像仓库

.RepoTags

map[] of zero or more FQIN strings for this image
用于此图像的零个或多个 FQIN 字符串的映射

.SharedSize

Always seems to be 0
看起来总是为 0

.Size

Size of layer on disk (human-friendly string)
磁盘上层的大小(人类可读的字符串)

.Tag

Image tag 镜像标签

.VirtualSize

Size of layer on disk (bytes)
磁盘上层的大小(字节)

--history --历史 ¶

Display the history of image names. If an image gets re-tagged or untagged, then the image name history gets prepended (latest image first). This is especially useful when undoing a tag operation or an image does not contain any name because it has been untagged.
显示图像名称的历史记录。如果图像被重新标记或取消标记,则图像名称历史记录将被添加(最新图像在前)。当撤消标记操作或图像不包含任何名称时,这将特别有用,因为它已被取消标记。

--no-trunc

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

--noheading, -n --noheading,-n ¶

Omit the table headings from the listing.
从列表中省略表头。

--quiet, -q

Lists only the image IDs.
仅列出图像 ID。

--sort=sort

Sort by created, id, repository, size or tag (default: created)
按创建时间、ID、仓库、大小或标签排序(默认:创建时间)

EXAMPLE 例子 ¶

List all non-dangling images in local storage:
列出本地存储中的所有非悬空镜像:

$ podman images
REPOSITORY                         TAG         IMAGE ID      CREATED       SIZE
quay.io/podman/stable              latest      e0b7dabc3352  22 hours ago  331 MB
docker.io/library/alpine           latest      9c6f07244728  5 days ago    5.83 MB
registry.fedoraproject.org/fedora  latest      2ecb6df95994  3 weeks ago   169 MB
quay.io/libpod/testimage           20220615    f26aa69bb3f3  2 months ago  8.4 MB

List all images matching the specified name:
列出所有与指定名称匹配的图像:

$ podman images stable
REPOSITORY             TAG         IMAGE ID      CREATED       SIZE
quay.io/podman/stable  latest      e0b7dabc3352  22 hours ago  331 MB

List image ids of all images in containers storage:
列出容器存储中所有图像的图像 ID:

# podman image ls --quiet
e3d42bcaf643
ebb91b73692b
4526339ae51c

List all images without showing the headers:
列出所有图像,不显示标题:

# podman images --noheading
docker.io/kubernetes/pause                   latest   e3d42bcaf643   3 years ago   251 kB
<none>                                       <none>   ebb91b73692b   4 weeks ago   27.2 MB
docker.io/library/ubuntu                     latest   4526339ae51c   6 weeks ago   126 MB

List all images without truncating output:
列出所有图像而不截断输出:

# podman image list --no-trunc
REPOSITORY                                   TAG      IMAGE ID                                                                  CREATED       SIZE
docker.io/kubernetes/pause                   latest   sha256:e3d42bcaf643097dd1bb0385658ae8cbe100a80f773555c44690d22c25d16b27   3 years ago   251 kB
<none>                                       <none>   sha256:ebb91b73692bd27890685846412ae338d13552165eacf7fcd5f139bfa9c2d6d9   4 weeks ago   27.2 MB
docker.io/library/ubuntu                     latest   sha256:4526339ae51c3cdc97956a7a961c193c39dfc6bd9733b0d762a36c6881b5583a   6 weeks ago   126 MB

List all image content with the formatted content:
列出所有图像内容以格式化内容:

# podman images --format "table {{.ID}} {{.Repository}} {{.Tag}}"
IMAGE ID       REPOSITORY                                   TAG
e3d42bcaf643   docker.io/kubernetes/pause                   latest
ebb91b73692b   <none>                                       <none>
4526339ae51c   docker.io/library/ubuntu                     latest

List any image that is not tagged with a name (dangling):
列出任何未标记名称的图像(悬空):

# podman images --filter dangling=true
REPOSITORY   TAG      IMAGE ID       CREATED       SIZE
<none>       <none>   ebb91b73692b   4 weeks ago   27.2 MB

List all images in JSON format:
以 JSON 格式列出所有图像:

# podman images --format json
[
    {
	"id": "e3d42bcaf643097dd1bb0385658ae8cbe100a80f773555c44690d22c25d16b27",
	"names": [
	    "docker.io/kubernetes/pause:latest"
	],
	"digest": "sha256:0aecf73ff86844324847883f2e916d3f6984c5fae3c2f23e91d66f549fe7d423",
	"created": "2014-07-19T07:02:32.267701596Z",
	"size": 250665
    },
    {
	"id": "ebb91b73692bd27890685846412ae338d13552165eacf7fcd5f139bfa9c2d6d9",
	"names": [
	    "\u003cnone\u003e"
	],
	"digest": "sha256:ba7e4091d27e8114a205003ca6a768905c3395d961624a2c78873d9526461032",
	"created": "2017-10-26T03:07:22.796184288Z",
	"size": 27170520
    },
    {
	"id": "4526339ae51c3cdc97956a7a961c193c39dfc6bd9733b0d762a36c6881b5583a",
	"names": [
	    "docker.io/library/ubuntu:latest"
	],
	"digest": "sha256:193f7734ddd68e0fb24ba9af8c2b673aecb0227b026871f8e932dab45add7753",
	"created": "2017-10-10T20:59:05.10196344Z",
	"size": 126085200
    }
]

List all images sorted by the specified column:
按指定列排序列出所有图像:

# podman images --sort repository
REPOSITORY                                   TAG      IMAGE ID       CREATED       SIZE
<none>                                      <none>   2460217d76fc   About a minute ago   4.41 MB
docker.io/library/alpine                    latest   3fd9065eaf02   5 months ago         4.41 MB
localhost/myapp                             latest   b2e0ad03474a   About a minute ago   4.41 MB
registry.access.redhat.com/rhel7            latest   7a840db7f020   2 weeks ago          211 MB
registry.fedoraproject.org/fedora           27       801894bc0e43   6 weeks ago          246 MB

Show the difference between listed images in use versus all images, including dangling images:
显示正在使用的图像与所有图像之间的差异,包括悬空图像:

# podman images
REPOSITORY                 TAG      IMAGE ID       CREATED         SIZE
localhost/test             latest   18f0c080cd72   4 seconds ago   4.42 MB
docker.io/library/alpine   latest   3fd9065eaf02   5 months ago    4.41 MB
# podman images -a
REPOSITORY                 TAG      IMAGE ID       CREATED         SIZE
localhost/test             latest   18f0c080cd72   6 seconds ago   4.42 MB
<none>                     <none>   270e70dc54c0   7 seconds ago   4.42 MB
<none>                     <none>   4ed6fbe43414   8 seconds ago   4.41 MB
<none>                     <none>   6b0df8e71508   8 seconds ago   4.41 MB
docker.io/library/alpine   latest   3fd9065eaf02   5 months ago    4.41 MB

SEE ALSO 参见 ¶

podman(1), containers-storage.conf(5)

HISTORY 历史 ¶

March 2017, Originally compiled by Dan Walsh <dwalsh@redhat.com>
2017 年 3 月,最初由 Dan Walsh 编写 <dwalsh@redhat.com>