8

I would like to check what image is a parent of my given Docker image (FROM with image layer it was created). How can I retrieve this information?

I tried do that through

docker images -t

but this flag is deprecated in new Docker versions. Is there any reliable source of such an info?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
ArturSkowronski
  • 1,722
  • 13
  • 17
  • Does this answer your question? [How to see tree view of docker images?](https://stackoverflow.com/questions/32454679/how-to-see-tree-view-of-docker-images) – Michael Freidgeim Jun 12 '21 at 21:55

2 Answers2

21

docker tree was deprecated before any good replacement was proposed (see the debate in PR 5001)

This is currently externalized to justone/dockviz.

 alias dockviz="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz"

Image info is visualized with lines indicating parent images:

dockviz images -d | dot -Tpng -o images.png

as a tree in the terminal:

$ dockviz images -t
└─511136ea3c5a Virtual Size: 0.0 B
  |─f10ebce2c0e1 Virtual Size: 103.7 MB
  | └─82cdea7ab5b5 Virtual Size: 103.9 MB
  ...
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 4
    it should be noted that with recent versions of docker / dockviz, output is full of ``` Virtual Size: xyz MB ``` which reduces the usefulness of the command. – Edoardo Nov 02 '16 at 08:25
0

Use dockerfile-from-image from https://github.com/CenturyLinkLabs/dockerfile-from-image, it will create a Dockerfile, which first line will be FROM xxx

user2915097
  • 30,758
  • 6
  • 57
  • 59