dive with Docker: See What Is Wasting Space in Your Images (Linux, Windows, Mac)
Before you start
- 20 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
dive is a free terminal tool that reads a Docker image, shows every layer and the files inside it, and estimates how much space is being wasted. It does not change the image.

Logo: dive has no official logo. Image: dive project, official CI-mode screenshot (github.com/wagoodman/dive, v0.13.1), MIT.
You use it when an image is bigger than you expect, when a build feels slow to upload, or when you want a CI job to stop an image from growing. It is also a good learning tool: you see which RUN line added the package cache or the build tools that never left the final image. It pairs well with a vulnerability scanner such as Trivy: dive looks at size and layers, Trivy looks for known security holes.
At a glance:
- What it is: one binary, or one short-lived container. No service, no port, no login.
- What it shows: layers, files added and removed, and an estimated efficiency score.
- What it does not do: scan for CVEs, update images, or change your Dockerfile.
- Where it runs: Linux, Windows, Mac, and CI. Podman is supported on Linux.
- Version to use:
v0.13.1. The README examples uselatest; this guide pins the version so a new release cannot change your gate without a commit.
| What | Value (official sources, read 2 December 2026) |
|---|---|
| Current version | dive v0.13.1, released 29 March 2025 (previous: v0.13.0, 21 March 2025) |
| Image to pin | docker.io/wagoodman/dive:v0.13.1 (Docker Hub tag checked; amd64 and arm64) |
| Time needed | About 15 minutes (our estimate, not measured) |
| Size | About 27 MB for the amd64 image (Docker Hub API size field, not measured by us) |
| RAM | Not measured. dive is a terminal program that exits when you quit, not a server |
| Ports | None |
| Licence | MIT (LICENSE at the release tag) |
| Official docs | github.com/wagoodman/dive |
How it fits together#
dive asks the Docker daemon for the image, reads the layers, builds a file tree and a waste estimate, then shows the result in a terminal UI or as a CI pass/fail.
Drawn for this guide from the official README, Docker docs and issue reports. Dashed steps are optional or manual.
The important part is the loop: dive only reports. If a layer is too big, you change the Dockerfile and rebuild. That is why the tool is useful before you publish an image, and even more useful in CI where the rebuild happens on every push.
Before you start#
Note: every domain, password and key on this page is a dummy example (like
change-me). Replace it with your own and keep real secrets out of Git.
You need a working Docker daemon and permission to talk to it. You do not need a domain, open ports, or a server.
| System | What to have |
|---|---|
| Linux | A 64-bit distribution with Docker Engine and the Docker CLI. About 30 MB free for the dive image or package. No GPU needed |
| Windows | Windows 10 or later, Docker Desktop with the WSL 2 backend, and PowerShell. About 30 MB free. No GPU needed |
| Mac | macOS with Docker Desktop, Intel or Apple Silicon. About 30 MB free. No GPU needed |
Check both commands:
docker --version docker ps
docker ps is the real test: it proves your user can reach the Docker socket. If it prints permission denied, fix that before installing dive.
Checklist:
- [ ]
docker pslists containers without a permission error - [ ] You have an image on the machine that you can inspect, or a project you can build
- [ ] You can rebuild that image without affecting production
- [ ] For CI: the runner can run Docker (a GitHub-hosted Ubuntu runner includes Docker; a Forgejo runner needs configuration)
Tested on 2026-12-02: Linux = not run, Windows = not run, Mac = not run. The commands come from the official README and release pages; we did not run them on a real machine.
Tip: Use a test image or a test tag. dive does not change the image, but the Docker socket it reads is powerful, so keep the experiment away from production.
Step 1: Install dive#
Linux#
On Ubuntu or Debian, the README downloads the .deb from the release page. This version is pinned, so the command keeps working after a new release:
DIVE_VERSION=0.13.1
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb"
sudo apt install ./dive_${DIVE_VERSION}_linux_amd64.deb
On RHEL or CentOS, use the .rpm asset and rpm:
DIVE_VERSION=0.13.1
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.rpm"
sudo rpm -i "dive_${DIVE_VERSION}_linux_amd64.rpm"
The README shows the amd64 asset. On another architecture, pick the matching asset from the release page. The README also documents a Snap package, but it warns that the Snap method is not recommended if Docker came from apt-get, because it can break the existing Docker daemon. Issue #546 shows the result: snap install dive pulled the snap Docker package, and docker images no longer showed the images from the apt Docker daemon. Do not mix the two.
Windows (PowerShell)#
The README uses winget:
winget install --id wagoodman.dive
If winget is not available, use the Docker image in Step 2 instead; the release page also has a Windows zip.
Mac (Terminal)#
The README uses the project's Homebrew tap:
brew tap wagoodman/dive brew install wagoodman/dive/dive
Check it worked.
dive -v
Expected: a version line that includes 0.13.1. The README warns that a go install build may not show the right version with dive -v; use the package or the Docker image if that matters to you.
Tip: Do not install
latestjust because the README uses it. A CI gate should change when you change the tag, not when the project publishes a release.
Step 2: Inspect an image#
Linux#
List the images on the machine, then pick one:
docker images dive <your-image-tag>
Windows (PowerShell)#
docker images dive <your-image-tag>
Mac (Terminal)#
Same commands as Linux.
If you use the Docker image instead of a native binary, mount the socket. On Linux and Mac:
docker run --rm -it \ -v /var/run/docker.sock:/var/run/docker.sock \ docker.io/wagoodman/dive:v0.13.1 <your-image-tag>
On Windows PowerShell:
docker run --rm -it ` -v /var/run/docker.sock:/var/run/docker.sock ` docker.io/wagoodman/dive:v0.13.1 <your-image-tag>
The screen shows the image name, a layer list and a file tree. Use Tab to switch between the layer list and the file tree, the arrow keys to move, and Ctrl+Space to collapse or expand all directories. Press Ctrl+C to quit.
What to look for:
- A layer that is much bigger than the others.
- Files that were added in one layer and deleted in a later one. They still take space in the image.
- Package caches, compiler output, or build tools that are not needed at runtime.
- An efficiency score that is lower than you expected. Treat the score as a hint, not a grade.
Check it worked. The terminal UI opens and the image name appears. If it opens, press Ctrl+C and try the feedback loop in the next step.
Tip: The efficiency score is experimental, as the README says. Compare two builds of the same app, not two different apps; the score is not a universal quality rating.
Step 3: Build and inspect in one command#
dive build builds the image with Docker and then opens the same analysis, so you do not have to copy the image tag.
Linux#
cd <path-to-your-project> dive build -t example/app:test .
Windows (PowerShell)#
Set-Location <path-to-your-project> dive build -t example/app:test .
Mac (Terminal)#
Same commands as Linux.
These commands assume the native binary. If you installed the Docker image instead, use the README's container dive build recipe (shown for macOS), which mounts the socket, the current directory and $HOME/.dive.yaml; replace latest with v0.13.1, and check the path mounts on Windows. Without those mounts the container cannot see your project.
Check it worked. The Docker build runs, then the dive screen opens for example/app:test. If the build fails, fix the Docker build first; dive can only analyse an image that was built.
Tip: Keep the tag simple and disposable, such as
example/app:test. Do not use the tag that production pulls.
Put it behind HTTPS with Traefik? You do not need to#
dive is a terminal program. It opens no port and serves no web page. There is nothing to route, so there are no Traefik labels and no Caddy reverse proxy to add.
With Traefik#
No labels or routes are needed.
Without Traefik: Caddy#
No reverse_proxy line is needed. If you later put a web wrapper around dive, that wrapper needs HTTPS; dive itself does not. For browser-based Docker tools, see our Dockge or Komodo guides.
Security and testing#
| Control | How |
|---|---|
| Docker socket | Access to /var/run/docker.sock is root-equivalent. :ro only stops changes to the socket file; it does not make the Docker API read-only |
| Image trust | Only inspect images you built or trust. dive reads image metadata and file names, which can be sensitive |
| Output | Do not paste private image output into a public issue; layer paths can reveal internal names |
| CI | Run the job only on trusted branches or pull requests. A workflow with the socket can control the runner's Docker daemon |
| Secrets | .dive-ci holds thresholds, not credentials. Keep registry tokens out of it |
Quick tests:
docker ps dive -v dive <your-image-tag> CI=true dive <your-image-tag>
A passing image exits 0 in CI mode. A rule failure exits non-zero. We did not run these commands; the expected behaviour is from the README and the CI section.
Shrink an image: a before-and-after example#
This is the pattern to look for, not a benchmark. We did not measure these images, and the point is the shape of the report, not a score.
| Stage | What dive shows | What to change |
|---|---|---|
| Before | A package cache in its own layer, build tools in the final image, files added and then deleted | Combine the install and cleanup in one RUN, remove the cache in that same layer, and use a multi-stage build |
| After | Fewer layers, no package cache, only the runtime files | Compare the new report with the old one and keep the change that removed the waste |
Commands:
dive build -t example/app:before . dive example/app:before # edit the Dockerfile dive build -t example/app:after . dive example/app:after
The fix is in the Dockerfile, not in dive. Common fixes are combining RUN commands, cleaning package caches in the same layer that created them, using a multi-stage build, and adding a .dockerignore. Change one thing at a time so you know which change helped.
Tip: A lower score is not always better. Removing a file the app needs is not a win. Check that the image still runs before you celebrate the smaller number.
Put dive in your CI pipeline#
A CI gate uses the same command with CI=true. dive prints the report and exits; it does not open the terminal UI. The thresholds live in .dive-ci at the root of the repository.
Start with this file and adjust the numbers to your app:
rules: lowestEfficiency: 0.95 highestWastedBytes: 20MB highestUserWastedPercent: 0.20
These are the example values from the README; treat them as a starting point, not a benchmark. On v0.13.1, lowestEfficiency fails when efficiency is below the value, while highestWastedBytes and highestUserWastedPercent fail when the waste is at least the value. PR #741 changes the wording for the next release to "more than", so do not build a threshold exactly on the boundary.
Forgejo Actions#
Save as .forgejo/workflows/dive.yaml:
name: dive
on:
push:
branches: [main]
jobs:
image-size:
runs-on: docker
steps:
- uses: actions/checkout@v7
- name: Build the image
run: docker build -t example/app:ci .
- name: Check the image with dive
run: |
docker run --rm \
-e CI=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$PWD:/work" \
-w /work \
docker.io/wagoodman/dive:v0.13.1 example/app:ci
This is the shape of the Forgejo docs' own Docker build example. The job container does not automatically get the host's Docker socket. If the runner is not configured for Docker access, the job fails with Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. The workflow above assumes the runner exposes the host socket (docker_host: automount). If your runner uses Docker-in-Docker, the socket mount is not the right path; follow the Forgejo docs or ask the runner administrator which setup is in use.
GitHub Actions#
Save as .github/workflows/dive.yaml:
name: dive
on:
push:
branches: [main]
jobs:
image-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build the image
run: docker build -t example/app:ci .
- name: Check the image with dive
run: |
docker run --rm \
-e CI=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$PWD:/work" \
-w /work \
docker.io/wagoodman/dive:v0.13.1 example/app:ci
GitHub-hosted Ubuntu runners include Docker; the Ubuntu 24.04 runner image lists Docker Client and Server. A self-hosted runner needs Docker installed and the socket available.
Check it worked. Push a commit and open the job log. A passing image ends with a dive report and a green job. A failing rule ends with a non-zero exit and the rule that failed.
Tip: On dive 0.13.1, do not use
CI=true dive --jsonas the only gate. The fix for "evaluate ci rules when also exporting json" is merged in PR #741 but is not in the release. Run the gate without--json, or run a second gate.
Common mistakes#
| Mistake | Why it happens | Do this instead |
|---|---|---|
AI assistants: adding DOCKER_API_VERSION=1.37 for Docker 29 | The v0.13.1 README still lists it for older Docker versions, and old answers repeat it | Remove it on Docker 29. The error is client version 1.43 is too old. Minimum supported API version is 1.44; dive 0.13.1 works with Docker 29 (issue 664) |
AI assistants: using latest in CI | The README examples use latest | Pin docker.io/wagoodman/dive:v0.13.1. A gate should change only when you change it |
| Using dive 0.12.0 with containerd | Older guides predate the containerd fix | Use 0.13.1. The error is could not find 'blobs/sha256/...' in parsed layers; #510 and #507 were fixed in 0.13.0 (issue 510) |
Setting only container-engine: podman | That setting chooses the engine, not the source | Add source: podman or use dive --source podman. The error is permission denied while trying to connect to the Docker daemon socket (issue 643) |
A minimal CI image without getent | Some slim images leave out the lookup tool | Use 0.13.1, where #582 is fixed, or add getent to the CI image. The error is exec: "getent": executable file not found in $PATH (issue 582) |
snap install dive next to apt Docker | Snap installs its own Docker package and hides the apt images | Use the .deb package or the Docker image. Do not mix snap and apt Docker (issue 546) |
CI=true dive --json as the only gate | In 0.13.1 the JSON path can skip the .dive-ci rules | Run the gate without --json; the fix is merged but unreleased (PR 741) |
| Ctrl+Space on Windows or Mac | The IME or input source takes the shortcut before dive sees it | Change the OS shortcut, or avoid the key. The dive issue is still open (issue 512) |
| Pressing Enter in the file tree on 0.13.1 | Enter and Ctrl+M send the same key code, and Ctrl+M toggles modified files | Press Ctrl+M again to show the files; the next release moves the toggle to Ctrl+N (PR 741) |
Tip: After a failed CI run, reproduce it locally with the same image tag and the same
.dive-ci. A threshold that passes on your laptop but fails in CI is usually a different image, not a different dive.
Troubleshooting#
| Problem | Solution |
|---|---|
dive: command not found | Install it again and check your PATH; on Windows, close and reopen PowerShell after winget |
permission denied on the Docker socket | Use a user that can run docker ps, or a rootless Docker setup. Adding a user to the docker group is root-equivalent; do it deliberately |
| The TUI opens but the image is wrong | Run docker images and use the exact tag. A short name resolves to :latest |
| CI fails but local dive passes | Compare the image tag, the .dive-ci file and the dive version; then run the exact CI command locally |
| The job cannot reach Docker | On Forgejo, the runner needs Docker access; see the error below. On GitHub, check that the runner has Docker |
client version 1.43 is too old. Minimum supported API version is 1.44#
Full text:
Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version
This is the Docker 29 API change. Remove any DOCKER_API_VERSION=1.37 you copied from an old guide and use dive 0.13.1. Issue #664 reports that 0.13.1 works with Docker 29.
could not find 'blobs/sha256/...' in parsed layers#
Full text (the hash changes with the image):
could not find 'blobs/sha256/93fc0ed6cd0f751d87163f074fea0524d6706bfc30f3be445cdbcaa9d6f187b2' in parsed layers
This is the containerd parsing bug in dive 0.12.0. Upgrade to 0.13.1; #510 and #507 were fixed in 0.13.0.
permission denied while trying to connect to the Docker daemon socket#
Full text from issue #643:
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.48/images/docker.io/library/debian:stable/json": dial unix /var/run/docker.sock: connect: permission denied
If you use Podman, add source: podman or --source podman; container-engine: podman alone is not enough. If you use Docker, your user cannot reach the socket. Fix that deliberately; do not add sudo to a CI job and call it done.
exec: "getent": executable file not found in $PATH#
Full text:
exec: "getent": executable file not found in $PATH
This was fixed in dive 0.13.1 by PR #586 (issue 582). Upgrade. If you are stuck on an older version, add getent to the CI image, but the upgrade is the real fix.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock#
Full text from the Forgejo docs:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
This is not a dive error. The Forgejo job container cannot see the host Docker socket. The runner administrator must configure Docker access, with Docker-in-Docker or container.docker_host: automount. The Forgejo docker-access docs describe both, including the security risk of sharing the host socket.
Known bugs (December 2026)#
--jsoncan skip the CI rules on 0.13.1. PR #741 adds "evaluate ci rules when also exporting json" but is unreleased. Run the gate without--jsonfor now.- Enter and Ctrl+M collide on 0.13.1. Enter in the file tree can hide modified files. Press Ctrl+M again. The next release moves the toggle to Ctrl+N.
- Whiteout via symlink displays the wrong folder. Issue #726 was fixed by PR #741 but is unreleased.
- Ctrl+Space is taken by the Windows IME or Mac input source. Issue #512 is still open; PR #729 is open. Change the OS shortcut or avoid the key.
- Snap dive can hide apt Docker images. Issue #546 is still open. Use the deb package or the Docker image.
- No release since March 2025. The project resumed activity in October 2026 and merged fixes in November, but the latest release is still v0.13.1. Pin it and do not rely on
latest.
Updates and backups#
Update dive. The latest release is v0.13.1 from 29 March 2025. No newer release was found on 2 December 2026. When a new release appears, read its notes first, then reinstall with the new DIVE_VERSION:
DIVE_VERSION=<new-version>
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb"
sudo apt install "./dive_${DIVE_VERSION}_linux_amd64.deb"
dive -v
For the Docker image, change the tag and pull:
docker pull docker.io/wagoodman/dive:<new-version>
Do not switch a CI gate to latest. The main branch has fixes that are not in v0.13.1, but main is not a release and can change at any time.
What to back up. dive has no data folder. Keep ~/.dive.yaml, ~/.config/dive/*.yaml, and the .dive-ci in each repository. If you use XDG_CONFIG_HOME or XDG_CONFIG_DIRS, back up those dive folders too. The .dive-ci file is already in Git if you commit it; that is the best backup for the thresholds.
Linux and Mac#
Save as ~/dive-config-backup.sh:
#!/usr/bin/env bash
set -euo pipefail
out="$HOME/dive-config-$(date +%F).tar.gz"
files=()
[ -e "$HOME/.dive.yaml" ] && files+=(".dive.yaml")
[ -e "$HOME/.config/dive" ] && files+=(".config/dive")
if [ ${#files[@]} -eq 0 ]; then
echo "No dive config found; .dive-ci lives in your repo."
exit 0
fi
tar -czf "$out" -C "$HOME" "${files[@]}"
chmod 600 "$out"
Run chmod 700 ~/dive-config-backup.sh, then add this line with crontab -e to run it every Sunday at 03:00:
0 3 * * 0 /home/<your-user>/dive-config-backup.sh
On a Mac, write /Users/<your-user>/dive-config-backup.sh in the cron line.
Windows (PowerShell)#
Save as $HOME\dive-config-backup.ps1:
$ErrorActionPreference = "Stop"
$out = "$HOME\dive-config-$(Get-Date -Format yyyy-MM-dd).tar.gz"
$items = @(".dive.yaml", ".config\dive") | Where-Object { Test-Path (Join-Path $HOME $_) }
if ($items.Count -eq 0) {
Write-Host "No dive config found; .dive-ci lives in your repo."
exit 0
}
Push-Location $HOME
tar -czf $out @items
if ($LASTEXITCODE -ne 0) { throw "tar failed" }
Pop-Location
In Task Scheduler, run powershell.exe -NoProfile -File <full-path-to-the-script> weekly on Sunday at 03:00.
Restore test#
Copy the archive to a spare folder, unpack it, then:
tar -xzf dive-config-<date>.tar.gz -C "$HOME" dive -v dive <your-image-tag>
On Windows PowerShell:
Set-Location $HOME tar -xzf "$HOME\dive-config-<date>.tar.gz" dive -v dive <your-image-tag>
The version prints and the TUI opens. The restore is only proven when the TUI opens with the restored config; we did not run this test.
Performance and resources#
dive is not a long-running service. There is no daemon or web app to watch. If you use the Docker image, the container exists only while the TUI is open. It reads the image, draws the screen, and exits when you quit.
- The amd64 Docker image is about 27 MB, from the Docker Hub API size field. The native package is a separate download; we did not compare sizes.
- We did not measure RAM, CPU, or the time to analyse an image. The time depends on the image and the number of layers.
- A very large image with many layers takes longer to read. Start with a small test image if you only want to learn the keys.
- The efficiency score is experimental and is not a performance benchmark. Use it to compare two builds of the same app.
- The README's
ignore-errorssetting lets dive continue after some errors. It can hide a broken image, so do not turn it on just to make a red job green. - The config file can change the file-tree width, hide the diff, or rebind keys. Those are display settings, not speed settings.
If you want to time a run, use your own shell's time command and record the image tag and dive version. We did not do this, so we give no number.
FAQ#
Does dive change my image? No. It reads the image and prints a report. The Dockerfile change and the rebuild are yours.
Does dive work with Docker 29 and containerd? Yes, with dive 0.13.1. The containerd parsing bug in 0.12.0 was fixed in 0.13.0, and issue #664 reports that 0.13.1 works with Docker 29. Do not use the old DOCKER_API_VERSION=1.37 workaround.
Does dive work with Podman? Yes, on Linux. Use dive <image> --source podman or dive podman://<image>. Setting only container-engine: podman is not enough, as issue #643 shows.
Can I use dive in CI? Yes. Put .dive-ci at the repo root and run CI=true dive <image>. A passing image exits 0; a failing rule exits non-zero. On 0.13.1, do not combine the gate with --json.
Is the project still maintained? The latest release is v0.13.1 from March 2025. The maintainer posted an update in the maintenance thread in October 2026, merged the stereoscope port (#727) and a batch of fixes (#741) in late 2026, and said a release is next. Until that release exists, 0.13.1 is what you can install.
Why does the README call it beta? The README says "This is beta quality!". The efficiency score is experimental. The layer and file views are still useful, but treat the score as a hint, not a guarantee.
Sources#
- dive README at v0.13.1: commands, install methods, CI mode,
.dive-ci, config paths, keybindings,--source, snap warning,DOCKER_API_VERSIONnote - Release v0.13.1 (29 March 2025) and release v0.13.0 (21 March 2025)
- LICENSE at v0.13.1 (MIT)
- Docker Hub tag v0.13.1 (API checked; amd64 and arm64 sizes)
- Issues read: 510, 664, 568, 643, 582, 512, 546, 726
- PR 741: CI, TUI and keybinding fixes merged 17 November 2026, unreleased
- Docker containerd image store and Docker Engine 29 announcement
- Forgejo Actions quick start and Utilizing Docker within Actions
- actions/checkout README (v7 is current) and GitHub Ubuntu runner image (Docker Client and Server listed)
Checked against the official docs on 2026-12-02. Nothing was run on a real machine by DIY Lab Hub; the commands come from the docs, the release pages and the issues above.