Skip to content

dive

A terminal tool for browsing each layer of a Docker image and finding wasted space.

Stars
54.7k
Forks
2k
Licence
MIT
Language
Go
Last update
6 days ago
Type
CLI

What it is

Dive is a command-line tool that opens a Docker image and lets you explore its contents layer by layer. You can see which files each layer adds, changes, or removes, and it estimates how much of the image is wasted space. People use it to understand why an image is large and to find ways to make it smaller.

  • Run dive on an image tag such as nginx:latest to browse its layers and file tree
  • Use dive build to build an image and analyze it in one command
  • Run with CI=true to skip the UI and get a pass/fail result based on a .dive-ci rules file
  • Inspect a Docker tar archive or a Podman image using the --source option

Great for

  • Developers who want to see why a Docker image is larger than expected
  • People trimming image sizes for faster pulls and deployments
  • Teams that want a CI check on image efficiency or wasted space
  • Anyone who wants a visual view of Docker layers in the terminal

Not ideal for

  • People who do not use Docker or OCI images, since the tool only inspects those
  • Teams needing a production-grade, fully stable tool, because the README says it is beta quality
  • Users who need the efficiency score to be exact, because the README calls that metric experimental
Step-by-step guide: how to use diveInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Docker or Podman, depending on the image source you use

    Mac with Homebrew

    brew install dive

    Windows with winget

    winget install --id wagoodman.dive

    Arch Linux with pacman

    pacman -S dive
  2. 2

    Run it

    • Install dive using one of the package commands above, or pull the Docker image
    • Run dive <your-image-tag> with a local image tag, ID, or digest
    • Use the arrow keys to select layers and browse the file tree
    • Press Tab to switch between the layer and file tree views
  3. 3

    Get the most out of it

    • Set CI=true to run dive without the UI and get a pass/fail return code
    • Add a .dive-ci file at the repo root to set lowestEfficiency, highestWastedBytes, or highestUserWastedPercent thresholds
    • Use --source docker-archive or --source podman to analyze images from other sources
    • Use Ctrl + F to filter files in the file tree

Downloads

Strengths

  • Shows exactly which files each layer adds, changes, or removes
  • Works with Docker, Docker archives, and Podman on Linux
  • Can run in CI with a simple pass/fail result

Trade-offs

  • The README describes the project as beta quality
  • The wasted-space efficiency metric is labeled experimental
  • Some Docker setups need extra environment variables such as DOCKER_API_VERSION or DOCKER_HOST

How it compares

ProjectStarsTypeLevelUpdatedBest for
dive (this)54.7kCLIbeginner6 days agoDevelopers who want to see why a Docker image is larger than expected
ctop17.8kCLIbeginner2.3 years agoDevelopers running several Docker containers locally who want a quick overview of resource use
bottom14.1kCLIbeginner4 days agoPeople who like watching system activity from a terminal instead of a graphical window
gogs47.9kAppintermediate5 days agoSmall teams that want a private Git server on their own hardware
Codewhale41.2kCLIintermediate4 days agoDevelopers who want an AI agent working inside a terminal and a git repository
dokku32.2kAppintermediate4 days agoDevelopers who want Heroku-style deployment on a server they control

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.