Interactive TUI for exploring Docker image layers, analyzing file changes, and identifying wasted space to optimize image size.
dive is a terminal user interface for analyzing Docker and OCI container images layer by layer. The tool displays a split-pane interface where users can select layers on the left and view their combined file contents on the right, navigating the file tree with arrow keys. It highlights files that have been added, modified, or removed in each layer and provides visual indicators for file changes across layers.
The tool calculates an experimental "image efficiency" score that estimates wasted space from duplicate files, unnecessary file movements, or incomplete file removals across layers. It shows both a percentage score and total wasted space in bytes. dive supports multiple container engines including Docker, Podman, and can analyze images from Docker tar archives using the --source flag.
dive integrates into CI pipelines through a headless mode activated with CI=true, which analyzes images and returns pass/fail results based on configurable efficiency thresholds defined in a .dive-ci file. The tool also supports building and immediately analyzing images with dive build -t tag ., replacing standard docker build commands. It's particularly useful for DevOps engineers and developers optimizing container image sizes and understanding layer composition.
# via Homebrew
brew install dive
# via Go
go install github.com/wagoodman/dive@latest
# via Docker
docker pull docker.io/wagoodman/dive

