Docker命令-history

命令

docker history

描述

Show the history of an image
显示镜像历史

用法

1
docker history [OPTIONS] IMAGE

选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Options:
--format 指定显示格式
--human , -H 以可读形式显示镜像大小和日期,默认为true
--no-trunc 显示完整内容,不截断显示
--quiet , -q 只显示镜像ID

--format支持的关键字
table 显示为表格形式,包括标题
.ID Image ID
.CreatedSince Elapsed time since the image was created if --human=true, otherwise timestamp of when image was created
.CreatedAt Timestamp of when image was created
.CreatedBy Command that was used to create the image
.Size Image disk size
.Comment Comment for image

注意

示例

1
2
3
$ docker history ubuntu
$ docker history nginx:1.20.1
$ docker history --format "{{.ID}}, {{.CreatedSince}}, {{.Size}}" busybox