Docker - How to get name (user / repo: tag) of base image used to create another image
When I run the docker history mysql
last line:
104de4492b99 9 days ago /bin/sh -c #(nop) ADD file:f35a56605b9a065a14 4.97 MB
I wanted to know which base image the id corresponds to f35a56605b9a065a14
, so I found the mysql Dockerfile on Github. First line:
FROM debian:wheezy
1) Can anyone confirm what is f35a56605b9a065a14
really the base image ID debian:wheezy
?
2) If I didn't have access to the Dockerfile, how would I make the connection that f35a56605b9a065a14
matches debian:wheezy
?
thank
source to share
When you only have an image and want to recreate the Dockerfile, you can use the dockerfile-from-image from
https://github.com/CenturyLinkLabs/dockerfile-from-image/blob/master/dockerfile-from-image.rb
this is some Ruby code (in a container, of course!) that finds all the commands used.
And, yes, f35 ... is a DEBIAN: WHEEZY identifier because
docker run -v /var/run/docker.sock:/var/run/docker.sock centurylink/dockerfile-from-image debian:wheezy
shows
ADD file:f35a56605b9a065a14a18d0e36fdf55c1c381d3521b4fa7f11173f0025d36839 in /
CMD ["/bin/bash"]
`
source to share