Remove unused anonymous Docker volumes (with symlink cleanup).
Project description
🧹 Docker Volume Cleaner (dockreap)
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/bootstrapare automatically excluded. - If a volume’s
_datadirectory 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
rootor membership in thedockergroup)
📜 License
This project is licensed under the MIT License.
👤 Author
Kevin Veen-Birkenbach 🌍 https://www.veen.world/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dockreap-1.0.0.tar.gz.
File metadata
- Download URL: dockreap-1.0.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4406e36bdc86883368e525cf8117e404f7535a6dda879772b722bc8f77938c3b
|
|
| MD5 |
b705ba83b7369be26768662f7f0402b9
|
|
| BLAKE2b-256 |
8cc3104f3e259e7c78d16970ef1dd48c98b88bca9ad4ffe87518f9f8fb7a7ede
|
File details
Details for the file dockreap-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dockreap-1.0.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3a5de073984ca8eb3f442dda41843c27fa0920c2dcab88fc84e6aa4ee6e36f2
|
|
| MD5 |
81b4185aa293426c50416502ef74ee2a
|
|
| BLAKE2b-256 |
7ca88491ea82c15c9a747dbbe8722481ad7db27716f6ff847d0f2c819b055cdb
|