如何在Docker映像中识别基本映像层

时间:2019-04-30 11:19:21

标签: docker dockerfile docker-image

我需要确定哪些docker图像层属于基本图像。 例如,“ mysql”映像由基本映像“ debian”以及几层组成。

    C:\WINDOWS\system32>docker history mysql
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
d72169616e20        5 days ago          /bin/sh -c #(nop)  CMD ["mysqld"]               0B
<missing>           5 days ago          /bin/sh -c #(nop)  EXPOSE 3306 33060            0B
<missing>           5 days ago          /bin/sh -c #(nop)  ENTRYPOINT ["docker-entry…   0B
<missing>           5 days ago          /bin/sh -c ln -s usr/local/bin/docker-entryp…   34B
<missing>           5 days ago          /bin/sh -c #(nop) COPY file:1667e4be6bef3129…   6.53kB
<missing>           5 days ago          /bin/sh -c #(nop) COPY dir:478f098f3681084f7…   1.22kB
<missing>           5 days ago          /bin/sh -c #(nop)  VOLUME [/var/lib/mysql]      0B
<missing>           5 days ago          /bin/sh -c {   echo mysql-community-server m…   328MB
<missing>           5 days ago          /bin/sh -c echo "deb http://repo.mysql.com/a…   56B
<missing>           5 days ago          /bin/sh -c #(nop)  ENV MYSQL_VERSION=8.0.16-…   0B
<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV MYSQL_MAJOR=8.0          0B
<missing>           4 weeks ago         /bin/sh -c set -ex;  key='A4A9406876FCBD3C45…   27.8kB
<missing>           4 weeks ago         /bin/sh -c apt-get update && apt-get install…   44.8MB
<missing>           4 weeks ago         /bin/sh -c mkdir /docker-entrypoint-initdb.d    0B
<missing>           4 weeks ago         /bin/sh -c set -x  && apt-get update && apt-…   4.44MB
<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV GOSU_VERSION=1.7         0B
<missing>           4 weeks ago         /bin/sh -c apt-get update && apt-get install…   10.2MB
<missing>           4 weeks ago         /bin/sh -c groupadd -r mysql && useradd -r -…   329kB
<missing>           4 weeks ago         /bin/sh -c #(nop)  CMD ["bash"]                 0B
<missing>           4 weeks ago         /bin/sh -c #(nop) ADD file:4fc310c0cb879c876…   55.3MB

想象一下,提取名为“ X”的图像,它具有基本图像“ mysql”和其他层,我如何知道哪些层用于“ mysql”,其他层用于图像“ X”

“ docker history X”命令向我显示所有图层,但不会将每个图层引用到基本图像。

有什么想法或工具可以帮助我吗?

0 个答案:

没有答案