Docker – 如何获取用于构build其他图像的基础图像的名称(用户/回购:标记)
当我运行docker history mysql
的最后一行是:
104de4492b99 9 days ago /bin/sh -c #(nop) ADD file:f35a56605b9a065a14 4.97 MB
我想知道id f35a56605b9a065a14
对应的基础映像,所以我在Github上find了mysql的Dockerfile。 第一行是:
FROM debian:wheezy
1)有人可以确认f35a56605b9a065a14
确实是debian:wheezy
的id debian:wheezy
base image?
2)如果我没有访问Dockerfile,我将如何去做连接f35a56605b9a065a14
对应于debian:wheezy
?
谢谢
当你只有一个图像,并且想要重新创buildDockerfile时,可以使用dockerfile-from-image
https://github.com/CenturyLinkLabs/dockerfile-from-image/blob/master/dockerfile-from-image.rb
它是一些Ruby代码(当然是在一个容器中),可以find所有使用的命令。
而且,是的,F35是DEBIAN的标识:WHEEZY,如
docker run -v /var/run/docker.sock:/var/run/docker.sock centurylink/dockerfile-from-image debian:wheezy
节目
ADD file:f35a56605b9a065a14a18d0e36fdf55c1c381d3521b4fa7f11173f0025d36839 in / CMD ["/bin/bash"]
`