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

Achieve 3D flip effect with pure CSS3 in a few simple steps

As a required course for front-end developers, CS...

CSS tips for controlling animation playback and pause (very practical)

Today I will introduce a very simple trick to con...

How to install ionCube extension using pagoda

1. First install the pagoda Installation requirem...

Detailed explanation of the Docker deployment tutorial for Jenkins beginners

This article deploys Jenkins+Maven+SVN+Tomcat thr...

Summary of using MySQL online DDL gh-ost

background: As a DBA, most of the DDL changes of ...

Several CSS3 tag shorthands (recommended)

border-radius: CSS3 rounded corners Syntax: borde...

Let's take a look at some powerful operators in JavaScript

Table of contents Preface 1. Null coalescing oper...

A designer complains about Hammer's official website again

Last year, the open letter was a huge hit, even a...

InnoDB engine redo file maintenance method

If you want to adjust the size and number of Inno...

MariaDB-server installation of MySQL series

Table of contents Tutorial Series 1. Install Mari...

Document Object Model (DOM) in JavaScript

Table of contents 1. What is DOM 2. Select elemen...

I have sorted out some domestic design websites that I think are good.

<br />I have compiled some domestic design w...

How to install openssh from source code in centos 7

Environment: CentOS 7.1.1503 Minimum Installation...

JavaScript selector functions querySelector and querySelectorAll

Table of contents 1. querySelector queries a sing...

Detailed explanation of linux crm deployment code

Linux basic configuration Compile and install pyt...