dive

Docker image layer analysis tool for exploring contents and optimizing image size

install

dive is a Docker image analysis tool that provides layer-by-layer exploration of container images. It displays the file tree contents of each layer, allowing users to navigate through files and directories using keyboard controls. The tool highlights file changes across layers, showing which files have been added, modified, or removed.

The tool calculates image efficiency metrics and estimates wasted space caused by duplicate files, unnecessary layer changes, or incomplete file removals. It provides both a percentage efficiency score and total wasted bytes measurement. Users can analyze images interactively through a terminal UI or integrate it into CI pipelines by setting CI=true to get pass/fail results based on configurable efficiency thresholds.

dive supports multiple container engines including Docker and Podman, and can analyze images from various sources including docker-archive files. It includes a build-and-analyze workflow with the dive build command, replacing standard docker build commands for immediate analysis. The tool works across Linux, macOS, and Windows platforms.

Installation

# via Homebrew
brew install dive
# via Go
go install github.com/wagoodman/dive@latest
# via Docker
docker pull docker.io/wagoodman/dive

dive TUI showing Docker image layer analysis

dive interface displaying image efficiency metrics

Alternatives & related tools

add a badge to your README

Maintain dive? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/dive.svg)](https://www.trmn.sh/tools/dive?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/dive?utm_source=badge"><img src="https://www.trmn.sh/badge/dive.svg" alt="Featured on trmn" height="20"></a>