dive
by
wagoodman

Description: A tool for exploring each layer in a docker image

View wagoodman/dive on GitHub ↗

Summary Information

Updated 15 minutes ago
Added to GitGenius on March 4th, 2026
Created on May 13th, 2018
Open Issues/Pull Requests: 202 (+0)
Number of forks: 1,980
Total Stargazers: 53,750 (+1)
Total Subscribers: 365 (+0)

Detailed Description

Dive is a powerful command-line tool designed to explore and analyze the contents of Docker and OCI container images. Its primary purpose is to provide users with a granular understanding of each layer within an image, facilitating the identification of inefficiencies and opportunities for size reduction. By visualizing the image's structure and highlighting changes across layers, Dive empowers developers to optimize their container builds and minimize wasted space.

The core functionality of Dive revolves around its interactive user interface. Upon running Dive with an image tag, ID, or digest, the tool presents a split-screen view. The left pane displays a list of layers, allowing users to select and inspect each one individually. The right pane then shows the combined contents of the selected layer and all preceding layers, effectively revealing the image's state at that point in the build process. This visual representation makes it easy to understand how files are added, modified, and removed across different layers.

A key feature of Dive is its ability to indicate changes within each layer. Files that have been added, modified, or removed are clearly highlighted in the file tree, providing a clear picture of the modifications introduced by each layer. Users can toggle between viewing changes specific to a single layer or aggregated changes across all preceding layers, offering flexibility in how they analyze the image's evolution.

Beyond simple layer inspection, Dive also provides an "image efficiency" estimate. This experimental metric attempts to quantify the amount of wasted space within the image, considering factors like file duplication, unnecessary file movement between layers, and incomplete file removal. The tool presents this information as both a percentage score and the total amount of wasted space in bytes, giving users a concrete measure of their image's efficiency.

Dive also offers a streamlined build and analysis workflow. The `dive build` command allows users to build a Docker image and immediately analyze it within the same command, eliminating the need for separate build and analysis steps. This integration significantly speeds up the development cycle, enabling developers to quickly iterate on their Dockerfiles and identify areas for improvement.

Furthermore, Dive is designed for integration into Continuous Integration (CI) pipelines. By setting the `CI=true` environment variable, users can run Dive in a non-interactive mode, allowing it to analyze an image and provide a pass/fail result based on user-defined criteria. This is achieved through a `.dive-ci` configuration file, where users can specify thresholds for image efficiency, wasted space, and wasted space percentage. This feature ensures that container images meet specific size and efficiency requirements before being deployed.

Dive supports multiple image sources and container engines, including Docker, Podman, and Docker archives. This flexibility allows users to analyze images built with different tools and from various sources. The tool is available for a wide range of operating systems, including Linux, macOS, and Windows, with installation options ranging from package managers like apt, yum, and brew to direct downloads and Go installations. The project is actively maintained and welcomes contributions, with a clear focus on providing a user-friendly and effective tool for Docker image optimization.

dive
by
wagoodmanwagoodman/dive

Repository Details

Fetching additional details & charts...