dive inspects Docker or OCI images layer by layer in a TUI, highlights file changes, and estimates wasted space. It can run in CI with JSON export or gate builds on efficiency rules.
Overview
dive is a command-line tool for exploring container images and understanding what each layer adds. Selecting a layer shows cumulative filesystem contents and which files were added, modified, or removed compared with earlier layers.
An efficiency view summarizes layer metadata and a heuristic score for duplicate or poorly removed files that may inflate image size. The dive build wrapper replaces docker build so you analyze an image immediately after building.
Images can be loaded from Docker, Podman, containerd, local OCI layouts, archives, or registries via a source flag, with optional platform selection for multi-arch manifests. Non-interactive CI mode skips the UI when CI=true and can fail builds based on a .dive-ci policy file.
Packages and binaries are available for common Linux distributions, macOS, and Windows, and the tool can run inside Docker with access to the host engine socket for analysis.
Key features
- Layer-by-layer filesystem browser
- Added and removed file highlighting
- Image efficiency waste estimate
- dive build after docker build
- Multiple image source backends
- CI pass-fail efficiency checks
- JSON analysis export
- Configurable TUI keybindings
Use cases
- Shrink Docker image size
- Debug Dockerfile layer bloat
- CI gate on image efficiency
- Compare OCI archive contents
- Explore registry images locally