Live data from Hacker News

Dive – A tool for exploring each layer in a Docker image

github.com

31–40 of 45 posts

Re: Dive – A tool for exploring each layer in a Docker image

#31
post #4

Nice!! have been waiting for something like this for a while. Gonna try this for sure.

just curious, how do you intend to use this? I mean, what problem does exploring each layer in a Docker solve for you?

It does two things for you: a) you get to visualize and explore the image layer by layer, and b) it will analyze and score the image with a % efficiency, listing all of the potential "inefficient" files.

In this way it's not just showing you a score... the score doesn't help you make the image any better. This is why letting the user explore the layers is good, to help discover and explain why there is an inefficiency (not just that there is one).

Re: Dive – A tool for exploring each layer in a Docker image

#33
post #2

This is amazing, thanks for sharing it! A very useful feature that I always missed but never actually tough about. I've had a hard time understanding the slices on the beginning will be very useful for troubleshooting bad images also while optimizing image sizes. Can probably help to understand problems like the one bug where the image size got almost a 2x increase after a CHOWN, because the slice is added again with…

We added a lib to a java image and the size went up by about 4x the library size, I spent a few hours trying to track it down to no avail. Hopefully this will help pin down the issue.

Re: Dive – A tool for exploring each layer in a Docker image

#37
post #25

Is there a tool to compare 2 or more images to check which layers they have in common?

Beyond Compare for Docker/Moby seems like an ideal use case for an inspection tool such as this. While space is cheap finding dbs which could be consolidated could have some tangible benefits for just about everyone.

Re: Dive – A tool for exploring each layer in a Docker image

#38
post #23

Can someone well versed in Docker explain in their own words what this does and why it is useful? Thanks in advance! I'm definitely not a docker poweruser...other than build start and stopping..

A docker image is built in layers that stack on top of each other. Think of each layer as a commit in a git repository. This project takes an image and shows the list of layers (=commits) and for each layer (=commit) allow you to see what was changed (=the diff). A bit like a git log for a docker image.

If OP looks up some Dockerfiles on docker hub, this will make more sense. Look at this mysql file for instance:

https://github.com/docker-library/mysql/blob/696fc899126ae00...

If two Dockerfiles use debain:stretch-slim as their base, docker won't download both base images twice. Each command in the Dockerfile creates an image. If you copy a Dockerfile and just change the last line and build them in order, the 2nd build will run a lot faster and you'll see in the output it pulls out "cached images" since it's already run those commands (docker build --no-cache always forced a full build).

If you start making Dockerfiles and playing around with it, it will start to make more sense.

Re: Dive – A tool for exploring each layer in a Docker image

#40
post #2

This is amazing, thanks for sharing it! A very useful feature that I always missed but never actually tough about. I've had a hard time understanding the slices on the beginning will be very useful for troubleshooting bad images also while optimizing image sizes. Can probably help to understand problems like the one bug where the image size got almost a 2x increase after a CHOWN, because the slice is added again with…

We added a lib to a java image and the size went up by about 4x the library size, I spent a few hours trying to track it down to no avail. Hopefully this will help pin down the issue.

Let us know if it’s a relatable issue. Might save someone else a headache in the future.
Post reply on HN