Skip to main content

Safe, explain-first Docker disk usage inspector and cleanup tool

Project description

Docker Disk Doctor

Docker Disk Doctor is a safe, explain-first CLI tool that shows how Docker is using disk space and what is safe to clean — without blindly running docker system prune.

Built from real homelab and infrastructure pain.


Why this exists

Docker is great… until your disk suddenly fills up.

At that point, most people run:

docker system prune -a

…and hope for the best.

Docker Disk Doctor exists to answer one simple question before you delete anything:

What exactly is using my disk space, and what is safe to remove?

This tool is safe-by-default.
It explains first — you decide what to clean.


Features

  • Full breakdown of Docker disk usage:
    • Images (used vs unused)
    • Containers (running vs stopped)
    • Volumes (attached vs orphaned)
  • Actual disk usage (MB / GB)
  • Clear, readable CLI tables
  • Safe-by-default cleanup (nothing is deleted unless you explicitly confirm)
  • Designed for homelabs, servers, and real systems

Screenshot

Click to expand example output

Docker Disk Doctor example output


Installation

Prerequisites

You need pipx.

On most Debian / Ubuntu systems:

sudo apt update
sudo apt install -y pipx
pipx ensurepath

You may need to open a new shell after running pipx ensurepath.


Install Docker Disk Doctor

Install directly from GitHub:

pipx install git+https://github.com/andreasrevdal/docker-disk-doctor.git

This installs the dockerdoctor command globally for your user.

Note: The tool is currently installed directly from GitHub.
A PyPI release (pipx install docker-disk-doctor) may come later.


Usage

Show disk usage breakdown (default)

dockerdoctor

This will display:

  • Used vs unused images
  • Running vs stopped containers
  • Attached vs orphaned volumes

No changes are made to your system.


Cleanup (optional)

Docker Disk Doctor is safe-by-default.

Nothing is deleted unless you explicitly confirm it.

Preview cleanup (dry-run)

dockerdoctor test clean all

You can also preview specific targets:

dockerdoctor test clean images
dockerdoctor test clean volumes

Apply cleanup

dockerdoctor clean all --yes

Or target specific resources:

dockerdoctor clean images --yes
dockerdoctor clean volumes --yes

The --yes flag is required to prevent accidental data loss.


Safety guarantees

  • No automatic deletions
  • No force-removal by default
  • No surprises
  • Docker may refuse to delete resources still in use — those are skipped safely

Support

If this tool saved you time, stress, or disk space,
consider buying me a compute ☕

https://buymeacoffee.com/revdal


License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker_disk_doctor-0.3.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docker_disk_doctor-0.3.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file docker_disk_doctor-0.3.0.tar.gz.

File metadata

  • Download URL: docker_disk_doctor-0.3.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for docker_disk_doctor-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7c682da595922c366c1d90205ba1c6ee54589772e4c61b3fbbdb8fa7740bbd88
MD5 ce7122cf945aea7dffe55af95894bc14
BLAKE2b-256 6ff6cc3f8409546f908ad360e7b3d4f462e5789d0e7a1907a2d861668b7822ad

See more details on using hashes here.

File details

Details for the file docker_disk_doctor-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_disk_doctor-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8467e9cea714724cba8cec4ad643fd2d9dad8e52f542ec2de289ed633047306a
MD5 2297687937a9f568f11fa4b86c0e26a6
BLAKE2b-256 3ad18641473efac3274a43ada9357d25e3adf73043f3d4bf867a13b5eb39391a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page