Skip to main content

🧹 Docker Volume Cleaner (dockreap)

GitHub Sponsors Patreon Buy Me a Coffee PayPal

dockreap is a lightweight Python CLI tool that helps you identify and remove unused anonymous Docker volumes — including symlinks and their targets 🗑️

Keep your Docker environment tidy, automated, and efficient 🚀


⚙️ Features

  • Detects anonymous Docker volumes (64-character hash names)
  • Skips whitelisted volumes
  • Skips bootstrap mounts (/var/www/bootstrap)
  • Cleans up symlinks and their target directories
  • Optional confirmation prompt via --no-confirmation
  • Pure Python — no external dependencies

📦 Installation

pip install dockreap

or with an isolated environment:

pipx install dockreap

Install from source (development)

git clone https://github.com/kevinveenbirkenbach/dockreap.git
cd dockreap
pip install .

🧪 Usage

# Basic usage (with confirmation prompt)
dockreap

# Skip confirmation
dockreap --no-confirmation

# Skip specific volumes by adding them to the whitelist
dockreap "volumeid1 volumeid2"

# Skip confirmation + whitelist
dockreap "volumeid1 volumeid2" --no-confirmation

📝 Notes:

  • Only volumes with 64-character hash names (anonymous volumes) are considered.
  • Volumes mounted at /var/www/bootstrap are automatically excluded.
  • If a volume’s _data directory is a symlink, both the symlink and its target directory are removed.
  • Volumes referenced by any container (running or stopped) are not deleted.

🔐 Requirements

  • Python ≥ 3.9
  • Docker CLI available and configured
  • Sufficient permissions to remove Docker volumes (usually requires root or membership in the docker group)

📜 License

This project is licensed under the MIT License.


👤 Author

Kevin Veen-Birkenbach 🌍 https://www.veen.world/

Metadata

Release files for dockreap 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dockreap 1.0.1
File Size Uploaded
dockreap-1.0.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dockreap 1.0.1
File Interpreter ABI Platform
dockreap-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / dockreap-1.0.1.tar.gz

Download URL dockreap-1.0.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1d6a4baeedb45ddaa010c5ea3b0c4711d0601e723446791220fa4cc610c966c7
BLAKE2b-256 checksum
How to use checksums
058b05626636958bebb567e6a044140a57f3e9c6a3d8dfc6e472f9de9aa61077
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / dockreap-1.0.1-py3-none-any.whl

Download URL dockreap-1.0.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26756f2a92a599274dc6f0f754923b8dbd1cf787a6ff8f6cb4f6dba39f409c9b
BLAKE2b-256 checksum
How to use checksums
8077680b214535ca84d5c29d78385abc644f64426bd8683e895c209510502c1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page