docker images --help
[qidai@qidai-pc ~]$ 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 仅显示数字ID
images 测试
[qidai@qidai-pc ~]$ docker images #列出所有顶层镜像
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 47b19964fb50 4 weeks ago 88.1MB
ubuntu 16.04 7e87e2b3bf7a 6 weeks ago 117MB
centos latest 1e1148e4cc2c 3 months ago 202MB
[qidai@qidai-pc ~]$ docker images ubuntu #根据镜像名过滤显示
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 47b19964fb50 4 weeks ago 88.1MB
ubuntu 16.04 7e87e2b3bf7a 6 weeks ago 117MB
[qidai@qidai-pc ~]$ docker images -f since=ubuntu:16.04 #-f参数过滤 ubuntu版本
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 47b19964fb50 4 weeks ago 88.1MB
[qidai@qidai-pc ~]$ docker images -q #只显示镜像的ID
47b19964fb50
7e87e2b3bf7a
1e1148e4cc2c
[qidai@qidai-pc ~]$ docker images -f since=ubuntu:16.04 -q #结合-f和-q参数,显示出ubuntu:16.04版本后的ubuntu版本的ID
47b19964fb50
对于--format
的使用可以自己参考Go语言的模板语法,比如
[qidai@qidai-pc ~]$ docker images --format "{{.ID}}\t{{.Repository}}\t{{.Tag}}"
47b19964fb50 ubuntu latest
7e87e2b3bf7a ubuntu 16.04
1e1148e4cc2c centos latest
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态