Let's say I want to inspect the amount of layers in my image, how many times the image has been modified before it came to its final form, how can I do this?
Asked
Active
Viewed 785 times
3
-
See also the [dive](https://github.com/wagoodman/dive) utility; slightly tangential, but useful for navigating image layers. – Jeff Schaller Oct 06 '21 at 17:48
-
Cool tool @JeffSchaller. I'll definitely check it out. If you're good on containers/podman please checkout [my other questions on `[podman]` that are unanwered.](https://unix.stackexchange.com/search?tab=newest&q=%5bpodman%5d%20is%3aunanswered%20user%3a3285%20is%3aquestion%20hasaccepted%3a0) I hope they're high quality, and they could probably use some love. – Evan Carroll Oct 06 '21 at 18:42
1 Answers
2
One method to do this is to use podman,
podman inspect localhost/my-image --format "{{len .RootFS.Layers}}"
This will tell you the amount of time the image's base file system was modified. You can find more information about the image by running podman inspect on the image to see the array of SHA modifications that we're counting in the above command.
Evan Carroll
- 28,578
- 45
- 164
- 290