A tool for exploring each layer in a docker image
Dive is a powerful CLI tool designed to help developers analyze Docker images, explore layer contents, and optimize container size. It provides an interactive terminal user interface that breaks down Docker images layer by layer, showing exactly what files are added, modified, or removed in each layer. This makes it invaluable for understanding how your images are constructed and identifying opportunities to reduce bloat.
The tool offers several key features including visual layer exploration, file change tracking across layers, and an experimental "efficiency score" that estimates how much wasted space your image contains. Dive can detect duplicate files across layers, unnecessary file movements, and incomplete file removals that contribute to larger image sizes. It also supports quick build-and-analyze workflows, allowing you to build a Docker image and immediately dive into its analysis with a single command.
Dive is particularly useful for DevOps engineers, Docker developers, and anyone working with containerized applications who wants to optimize their images for production. The tool integrates seamlessly into CI/CD pipelines, providing pass/fail results based on configurable efficiency thresholds. It supports multiple container engines including Docker and Podman, and can analyze images from various sources including local Docker engines, tar archives, and remote registries.
# via Homebrew
brew install dive
# via APT
sudo apt install ./dive_${DIVE_VERSION}_linux_amd64.deb
# via Go
go install github.com/wagoodman/dive@latest

