1 查看镜像id
即执行如下命令:
[root@node-1 ~]# docker images|grep xxx
docker.io/xxx 1.0 5d1b456495fc 20 hours ago 1.64 GB
注意:
请将xxx替换为你需要查找的镜像名称
2 查看该镜像的分层情况
即执行如下命令:
docker history <image_id>
解释:
docker history是查看镜像的创建历史,最下面是分层的最底层。
[root@node-1 ~]# docker history 5d1b456495fc
IMAGE CREATED CREATED BY SIZE COMMENT
5d1b456495fc 20 hours ago /bin/sh -c #(nop) USER yyy 0 B
<missing> 20 hours ago /bin/sh -c #(nop) LABEL maintainer=xxx... 0 B
<missing> 20 hours ago /bin/sh -c #(nop) LABEL last-commit-id=08... 0 B
<missing> 20 hours ago /bin/sh -c chmod 750 /etc/sudoers.d &&... 535 B
<missing> 20 hours ago /bin/sh -c pip install tenacity===3.1.0 ... 186 MB
<missing> 20 hours ago /bin/sh -c #(nop) COPY file:f483b3f3d6368f... 117 B
<missing> 20 hours ago /bin/sh -c #(nop) COPY file:a82f5a713f9ec5... 418 B
<missing> 20 hours ago /bin/sh -c mkdir /gnocchi-base-source && c... 370 MB
<missing> 20 hours ago /bin/sh -c mkdir -p /var/www/cgi-bin/gnocc... 21.2 kB
<missing> 20 hours ago /bin/sh -c yum -y install httpd mod_ssl mo... 27 MB
<missing