Reduce Docker image size by identifying which layers contain unnecessary or duplicate files.
Debug unexpected files or dependencies in a Docker image without running the container.
Enforce image size and efficiency standards in CI/CD pipelines by failing builds that exceed thresholds.
Optimize Dockerfiles by spotting opportunities to combine RUN commands or clean up temporary files.
Requires Docker or Podman to be installed and running locally.
Dive is a command-line tool for inspecting Docker container images layer by layer. Docker images are built in layers, where each layer represents a set of filesystem changes from a specific step in the build process. Without a tool like Dive, the only way to understand what is inside a Docker image and why it is so large is to run the container and poke around, which is tedious. Dive gives you an interactive terminal interface where you can navigate through each layer of an image, see exactly which files were added, changed, or removed in that layer, and understand how much space each layer contributes. The tool works by reading the Docker image from your local Docker daemon (or a saved archive, or from Podman), extracting each layer's filesystem changes, and presenting them in a split-panel terminal interface. The left panel shows the layers; the right panel shows the combined filesystem state up to the selected layer. Files that changed are highlighted by type of change. Dive also calculates an "image efficiency" score estimating how much space is wasted by things like files being overwritten or unnecessarily duplicated across layers. This helps identify Dockerfile optimizations like combining multiple RUN commands or cleaning up temporary files within the same layer that created them. A CI mode (activated by setting the environment variable CI=true) skips the interactive interface and instead analyzes the image automatically, returning a pass or fail result based on configurable thresholds for efficiency and wasted space. You would use Dive when you want to shrink a Docker image, debug unexpected image contents, or enforce image size policies in a continuous integration pipeline. It is built in Go and available as a binary, Homebrew formula, or Docker image itself.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.