explaingit

wagoodman/dive

53,952GoAudience · developerComplexity · 2/5MaintainedLicenseSetup · easy

TLDR

Interactive CLI tool to inspect Docker image layers, see what files changed in each layer, and identify ways to shrink your images.

Mindmap

mindmap
  root((dive))
    What it does
      Inspect layers
      View file changes
      Calculate efficiency
      Highlight waste
    How to use
      Interactive mode
      CI mode
      Local images
      Remote images
    Use cases
      Shrink images
      Debug contents
      Enforce policies
    Tech stack
      Go
      Docker
      Podman

Things people build with this

USE CASE 1

Reduce Docker image size by identifying which layers contain unnecessary or duplicate files.

USE CASE 2

Debug unexpected files or dependencies in a Docker image without running the container.

USE CASE 3

Enforce image size and efficiency standards in CI/CD pipelines by failing builds that exceed thresholds.

USE CASE 4

Optimize Dockerfiles by spotting opportunities to combine RUN commands or clean up temporary files.

Tech stack

GoDockerPodman

Getting it running

Difficulty · easy Time to first run · 5min

Requires Docker or Podman to be installed and running locally.

MIT license allows free use for any purpose, including commercial, as long as you include the original copyright notice.

In plain English

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.

Copy-paste prompts

Prompt 1
How do I use Dive to inspect a Docker image and see which layer is making it large?
Prompt 2
Show me how to set up Dive in a CI pipeline to automatically fail builds if image efficiency is below 80%.
Prompt 3
I have a Docker image that's 2GB. Walk me through using Dive to find and remove wasted space.
Prompt 4
How do I run Dive on a Docker image saved as a tar archive instead of from the Docker daemon?
Prompt 5
What does Dive's efficiency score measure, and how can I improve it in my Dockerfile?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.