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

Solution to the MySQL server has gone away error

MySQL server has gone away issue in PHP 1. Backgr...

A graphic tutorial on how to install MySQL in Windows

Abstract: This article mainly explains how to ins...

Introduction to Vue3 Composition API

Table of contents Overview Example Why is it need...

How to use vs2019 for Linux remote development

Usually, there are two options when we develop Li...

Solve the Linux Tensorflow2.0 installation problem

conda update conda pip install tf-nightly-gpu-2.0...

How to deploy zabbix_agent in docker

zabbix_agent deployment: Recommendation: zabbix_a...

Summary of new usage examples of computed in Vue3

The use of computed in vue3. Since vue3 is compat...

JavaScript web page entry-level development detailed explanation

Part 3: ❤Three ways to overlook backend data rece...

Steps to deploy Spring Boot project using Docker

Table of contents Create a simple springboot proj...

Vue custom components use event modifiers to step on the pit record

Preface Today, when I was using a self-written co...

Realize breadcrumb function based on vue-router's matched

This article mainly introduces the breadcrumb fun...

Solve the problem of ugly blue border after adding hyperlink to html image img

HTML img produces an ugly blue border after addin...