Dive is a free Docker image layers explorer to see each layer in a Docker image. Here this tool takes name or image ID of a Docker image and then helps you explore each of its layers. It shows a detailed preview of the image in the terminal and to show associated files and permissions. It also shows different versions of the specified image and then you can explore the target Docker image accordingly. It allows you to explore any Docker image and lets you visualize the layer contents and you can discover ways to shrink your image to reduce its size as well.
If you are familiar with Docker images then you probably having an idea how they work. Docker images are packed in layers and layers are generally different files. And if you need some tool to explore those layers inside a Docker image then Dive is the right tool for that. It runs on MAC and Linux machines. You can easily install it and then start exploring Docker images to see their layer contents. You can read this post on Medium to read all about Docker image layers. To use this command line tool, you just need Docker and Wget installed on your PC.
How to See Each Layer in a Docker Image with this Docker Image Layers Explorer?
Dive is an open source tool to explore Docker images layer by layer. You can install it right from the command line and then simply start using it to explore Docker images. Before starting with this tool, I am assuming that you have Docker installed and you are signed in.
Open terminal and then run this command to download the binary for Dive. This command is for Debian based distros and if you use other distro then you can find the corresponding instructions on its GitHub page.
Now, run this command to install the downloaded binary. After its done, you can then start using it.
sudo apt install ./dive_0.3.0_linux_amd64.deb
Make that you are logged in Docker and then you can run the command in the following syntax. If you don’t know how to install Docker then the best way is to install it through Snapcraft.
After running the above command, it will fetch that image and then you can see the analysis result that it puts on the terminal window. You can navigate through the different sections using Tab and Arrow keys. You can see a lot of details about the Docker image you are exploring and do whatever you want.
If you use Docker so often then you will really like this simple tool. If you have a mere interest in exploring Docker images then this tool will help you. You just have to run a single command to analyze any Docker image using its image ID, tag, and digest.
Dive is a very good tool for Docker uses to be used as a simple Docker images explorer. I really liked it for its simplicity and the way it lets you explore each layer of a Docker image right from the terminal. So, if you are looking for an easy to way to visualize docker images by layers then this post will be helpful.