Skip to main content

Remove unused anonymous Docker volumes (with symlink cleanup).

Project description

🧹 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

Install from PyPI (recommended)

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/

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

dockreap-1.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

dockreap-1.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file dockreap-1.0.1.tar.gz.

File metadata

  • Download URL: dockreap-1.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for dockreap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1d6a4baeedb45ddaa010c5ea3b0c4711d0601e723446791220fa4cc610c966c7
MD5 ddb84791d13cfc77aeff9bb83aad74ce
BLAKE2b-256 058b05626636958bebb567e6a044140a57f3e9c6a3d8dfc6e472f9de9aa61077

See more details on using hashes here.

File details

Details for the file dockreap-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dockreap-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for dockreap-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26756f2a92a599274dc6f0f754923b8dbd1cf787a6ff8f6cb4f6dba39f409c9b
MD5 28fdbab7eed684ec2c30263089b01cc8
BLAKE2b-256 8077680b214535ca84d5c29d78385abc644f64426bd8683e895c209510502c1f

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