1、命令
docker history : 查看指定镜像的创建历史
2、语法:
docker history [OPTIONS] IMAGE
OPTIONS说明:
-H :以可读的格式打印镜像大小和日期,默认为true;
--no-trunc :显示完整的提交记录;
-q :仅列出提交记录ID。
3、示例:
[root@localhost deploy]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
vertiv/phoenix_frontend latest fb13f56670d8 6 weeks ago 418MB
lsassiteweb latest e72bd7ec713e 6 weeks ago 482MB
datahub latest 73ec8edc146b 6 weeks ago 352MB
vertiv/phoenix_backend latest b9c0a9141596 6 weeks ago 310MB
sitewebwinservicehost latest d8509877afd8 6 weeks ago 192MB
vertiv/phoenix_indicators latest a5d100768525 2 months ago 171MB
influxdb 2.1 1f5a04237d8e 4 months ago 346MB
vertiv/redisbash latest ce47d4a0a382 6 months ago 110MB
vertiv/robin-m latest 7eef79eaf226 6 months ago 179MB
mysql 8.0.22 d4c3cafb11d5 16 months ago 545MB
[root@localhost deploy]# docker history d4c3cafb11d5
IMAGE CREATED CREATED BY SIZE COMMENT
d4c3cafb11d5 16 months ago /bin/sh -c #(nop) CMD ["mysqld"] 0B
<missing> 16 months ago /bin/sh -c #(nop) EXPOSE 3306 33060 0B
<missing> 16 months ago /bin/sh -c #(nop) ENTRYPOINT ["docker-entry… 0B
<missing> 16 months ago /bin/sh -c ln -s usr/local/bin/docker-entryp… 34B
<missing> 16 months ago /bin/sh -c #(nop) COPY file:a209112a748b68e0… 13.1kB
<missing> 16 months ago /bin/sh -c #(nop) COPY dir:2e040acc386ebd23b… 1.12kB
<missing> 16 months ago /bin/sh -c #(nop) VOLUME [/var/lib/mysql] 0B
<missing> 16 months ago /bin/sh -c {
echo mysql-community-server m… 410MB
<missing> 16 months ago /bin/sh -c echo 'deb http://repo.mysql.com/a… 55B
<missing> 16 months ago /bin/sh -c #(nop) ENV MYSQL_VERSION=8.0.22-… 0B
<missing> 16 months ago /bin/sh -c #(nop) ENV MYSQL_MAJOR=8.0 0B
<missing> 16 months ago /bin/sh -c set -ex; key='A4A9406876FCBD3C45… 2.61kB
<missing> 16 months ago /bin/sh -c apt-get update && apt-get install… 52.2MB
<missing> 16 months ago /bin/sh -c mkdir /docker-entrypoint-initdb.d 0B
<missing> 16 months ago /bin/sh -c set -eux; savedAptMark="