← 返回命令列表

Linux command

dive 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Analyze a Docker image

dive [image:tag]

Analyze with CI mode

dive [image:tag] --ci

Build and analyze

dive build -t [image:tag] [.]

Analyze from tar archive

dive --source [docker-archive] [image.tar]

Set efficiency threshold

dive [image:tag] --ci --highestUserWastedPercent [0.1]

说明

dive is a tool for exploring Docker image contents and layer efficiency. It provides an interactive TUI showing what changed in each layer, helping identify opportunities to reduce image size. The tool displays a layer-by-layer breakdown of the image filesystem, highlighting added, removed, and modified files. The efficiency score indicates how well the image is optimized, with wasted space shown explicitly. dive integrates into CI pipelines to enforce image efficiency requirements. It can analyze images from Docker, Podman, or archive files, and can build images before analysis.

参数

--ci
CI mode (no TUI, returns exit code).
--source _SOURCE_
Image source: docker, podman, docker-archive.
build _args_
Build image then analyze.
--highestUserWastedPercent _N_
Max wasted space percentage for CI pass.
--lowestEfficiency _N_
Minimum efficiency for CI pass.
--json
Output results as JSON.
--help
Display help information.

FAQ

What is the dive command used for?

dive is a tool for exploring Docker image contents and layer efficiency. It provides an interactive TUI showing what changed in each layer, helping identify opportunities to reduce image size. The tool displays a layer-by-layer breakdown of the image filesystem, highlighting added, removed, and modified files. The efficiency score indicates how well the image is optimized, with wasted space shown explicitly. dive integrates into CI pipelines to enforce image efficiency requirements. It can analyze images from Docker, Podman, or archive files, and can build images before analysis.

How do I run a basic dive example?

Run `dive [image:tag]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --ci do in dive?

CI mode (no TUI, returns exit code).