前言
- 本篇来学习下docker images命令
docker images
- 作用:列出所有的本地镜像
语法格式
docker images [OPTIONS] [REPOSITORY[:TAG]]
options说明
| options | 作用 |
|---|---|
| -a, --all | 列出本地所有的镜像(含中间镜像层,默认情况下,过滤掉中间映像层) |
| –digests | 显示镜像的摘要信息 |
| -f, --filter filter | 显示满足条件(filter)的镜像 |
| –format string | 使用模板格式化输出 |
| –no-trunc | 显示完整的镜像信息 |
| -q, --quiet | 只显示镜像ID |
使用示例
不带参数
- 列出本地所有的镜像

-a
# 列出本地所有的镜像(含中间镜像层,默认情况下,过滤掉中间映像层)
docker images -a

–digests
# 显示镜像的摘要信息
docker images --digests

–filter
# 筛选创建时间在nginx镜像之前的镜像信息
docker images --filter "since=nginx"
# 筛选悬空(仓库或标签为none)的镜像信息
docker images --filter "dangling=true"

–format
# josn 格式输出
docker images --format='{{json .}}'

–no-trunc
# 显示完整镜像信息
docker images --no-trunc

-q
# 显示镜像id
docker images -q

本文详细介绍了Docker中用于管理本地镜像的docker images命令。包括该命令的基本语法、多种选项参数及其具体用途,并提供了丰富的实际操作示例。
4856

被折叠的 条评论
为什么被折叠?



