Docker image analysis tool dive principle analysis

Docker image analysis tool dive principle analysis

Today I recommend such an open source tool for exploring Docker images, the contents of each layer, and finding ways to reduce the size of Docker/OCI images. That tool is: dive.

Tool address: https://github.com/wagoodman/dive, Star count: 22k+.

This tool can clearly see what is included in each layer of the image, so that you can analyze whether it is necessary, as shown in the figure below.

characteristic

Key features of the tool include:

  • Display Docker image contents by layer;
  • Point out the changes in each layer;
  • Evaluate the "efficiency of the mirror";
  • Fast build/analysis cycles;
  • Integration with CI;
  • Supports multiple images and container engines: such as docker, docker-archive and podman;

Installation and Usage

1. Mainly use docker to run dive. For specific usage, please refer to the official website:

https://github.com/wagoodman/dive

2. Pull the dive image

docker pull quay.io/wagoodman/dive:latest

3. Run dive through docker to view the image layer information

docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
quay.io/wagoodman/dive:latest \
nginx:latest

Note: The last nginx:latest is the image name to be viewed or can be directly replaced with the image ID. The open interface is as follows:

KeyBindings

Key Binding Description
<kbd>Ctrl + C</kbd> quit
<kbd>Tab</kbd> or <kbd>Ctrl + Space</kbd> Switch between layer and file tree view
<kbd>Ctrl + F</kbd> Filtering Files
<kbd>Ctrl + A</kbd> Layer View: View aggregated image modifications
<kbd>Ctrl + L</kbd> Layer View: View current layer modifications
<kbd>Space</kbd> Filetree view: collapse/uncollapse directories
<kbd>Ctrl + A</kbd> Filetree view: Show/hide added files
<kbd>Ctrl + R</kbd> Filetree view: show/hide deleted files
<kbd>Ctrl + M</kbd> Filetree view: show/hide modified files
<kbd>Ctrl + U</kbd> Filetree view: show/hide unmodified files
<kbd>PageUp</kbd> Filetree view: scroll up the page
<kbd>PageDown</kbd> Filetree view: scroll down the page

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Will the deprecated Docker be replaced by Podman?
  • Podman boots up the container automatically and compares it with Docker

<<:  Detailed explanation of how to gracefully delete a large table in MySQL

>>:  Summary of XHTML application in web design study

Recommend

Our thoughts on the UI engineer career

I have been depressed for a long time, why? Some t...

The process of installing Docker in Linux system

In this blog, I will walk you through the process...

Use pictures to realize personalized underline of hyperlinks

Don't be surprised if you see some kind of und...

Binary installation of mysql 5.7.23 under CentOS7

The installation information on the Internet is u...

Detailed explanation of triangle drawing and clever application examples in CSS

lead Some common triangles on web pages can be dr...

HTML exceeds the text line interception implementation principle and code

The HTML code for intercepting text beyond multipl...

Docker beginners' first exploration of common commands practice records

Before officially using Docker, let's first f...

How to install docker and portainer in kali

With the emergence of docker, many services have ...

uniapp Sample code for implementing global sharing of WeChat mini-programs

Table of contents Create a global shared content ...

Understanding render in Vue scaffolding

In the vue scaffolding, we can see that in the ne...

Detailed explanation of Json format

Table of contents A JSON is built on two structur...

Common problems and solutions during MySQL MGR construction

Table of contents 01 Common Faults 1 02 Common Fa...

Sample code for configuring nginx to support https

1. Introduction Are you still leaving your websit...