Kevin Veen-Birkenbach 57087c1bd7 Release version 1.0.0
2025-12-28 11:28:27 +01:00
2025-12-28 11:10:36 +01:00
2025-12-28 11:28:27 +01:00
2025-04-07 14:40:00 +02:00
2025-12-28 11:28:27 +01:00

🧹 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 volumes _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/

Description
A Python tool to safely detect and remove unused anonymous Docker volumes. Supports whitelisting, symlink cleanup, and optional confirmation prompts. Ideal for keeping your Docker environment clean and efficient.
Readme MIT 60 KiB
Languages
Python 93.4%
Makefile 6.6%