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

How to select all child elements and add styles to them in CSS

method: Take less in the actual project as an exa...

How to start a Vue.js project

Table of contents 1. Node.js and Vue 2. Run the f...

Use jQuery to fix the invalid page anchor point problem under iframe

The application scenario is: the iframe page has n...

How to create dynamic QML objects in JavaScript

1. Dynamically create objects There are two ways ...

Introduction to the usage of common XHTML tags

There are many tags in XHTML, but only a few are ...

js to realize web message board function

This article example shares the specific code of ...

Running PostgreSQL in Docker and recommending several connection tools

1 Introduction PostgreSQL is a free software obje...

Docker installation tomcat dubbo-admin instance skills

1. Download the tomcat image docker pull tomcat:8...

Vue implementation example using Google Recaptcha verification

In our recent project, we need to use Google robo...

Three solutions for sub-functions accessing external variables in JavaScript

Preface When we write web pages, we will definite...

Velocity.js implements page scrolling switching effect

Today I will introduce a small Javascript animati...

Tutorial on installing and uninstalling python3 under Centos7

1. Install Python 3 1. Install dependency package...

Detailed explanation of JQuery selector

Table of contents Basic selectors: Level selector...