云游屋
扫描关注云游屋

云游屋

docker images 命令

云游屋2021-09-06Docker命令 843

该命令用于查看本地储存的 Docker 镜像。

语法

docker images [OPTIONS] [REPOSITORY[:TAG]]

常用参数

  • -a:显示所有镜像,包括中间镜像(悬挂镜像),默认不显示

  • -f:过滤显示,可选的值有:

  • 是否无标签:$ docker images -f dangling=[true | false]

  • 标签值:$ docker images -f label=<key>[=<value>]

  • 在某镜像之前创建:$ docker images -f before=(<image-name>[:tag] | <image-id> | <image@digest>)

  • 在某镜像之后创建:$ docker images -f since=(<image-name>[:tag] | <image-id> | <image@digest>)

  • -q:只显示 id

实例

显示所有镜像

docker images

显示所有拥有标签镜像

docker images -f dangling=false

显示在 ubuntu 镜像之后创建的所有镜像

docker images -f since=ubuntu

帮助

$ docker images --help

Usage:  docker images [OPTIONS] [REPOSITORY[:TAG]]

List images

Options:
  -a, --all             Show all images (default hides intermediate images)
      --digests         Show digests
  -f, --filter filter   Filter output based on conditions provided
      --format string   Pretty-print images using a Go template
      --no-trunc        Don't truncate output
  -q, --quiet           Only show numeric IDs


发表评论