2025-12-28 11:27:37 +01:00
# 🧹 Docker Volume Cleaner (dockreap)
2025-12-28 11:10:36 +01:00
2025-12-28 11:27:37 +01:00
[](https://github.com/sponsors/kevinveenbirkenbach)
[](https://www.patreon.com/c/kevinveenbirkenbach)
[](https://buymeacoffee.com/kevinveenbirkenbach)
[](https://s.veen.world/paypaldonate)
2025-04-07 14:47:10 +02:00
2025-12-28 11:27:37 +01:00
**dockreap** is a lightweight Python CLI tool that helps you identify and remove unused **anonymous Docker volumes ** — including symlinks and their targets 🗑️
2025-04-07 14:47:10 +02:00
Keep your Docker environment tidy, automated, and efficient 🚀
---
2025-04-07 14:56:04 +02:00
## ⚙️ Features
2025-12-28 11:27:37 +01:00
- Detects anonymous Docker volumes (64-character hash names)
2025-04-07 14:56:04 +02:00
- Skips whitelisted volumes
- Skips bootstrap mounts (`/var/www/bootstrap` )
- Cleans up symlinks **and ** their target directories
- Optional confirmation prompt via `--no-confirmation`
2025-12-28 11:27:37 +01:00
- Pure Python — **no external dependencies **
2025-04-07 14:56:04 +02:00
---
2025-04-07 14:47:10 +02:00
## 📦 Installation
2025-12-28 11:27:37 +01:00
### Install from PyPI (recommended)
2025-04-07 14:47:10 +02:00
```bash
2025-12-28 11:27:37 +01:00
pip install dockreap
2025-04-07 14:47:10 +02:00
```
2025-12-28 11:27:37 +01:00
or with an isolated environment:
```bash
pipx install dockreap
```
### Install from source (development)
```bash
git clone https://github.com/kevinveenbirkenbach/dockreap.git
cd dockreap
pip install .
```
2025-04-07 14:47:10 +02:00
---
2025-12-28 11:27:37 +01:00
## 🧪 Usage
2025-04-07 14:47:10 +02:00
2025-04-07 14:56:04 +02:00
```bash
2025-12-28 11:27:37 +01:00
# Basic usage (with confirmation prompt)
2025-04-07 14:56:04 +02:00
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:
2025-12-28 11:27:37 +01:00
* 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.
2025-04-07 14:47:10 +02:00
---
2025-12-28 11:27:37 +01:00
## 🔐 Requirements
2025-04-07 14:47:10 +02:00
2025-12-28 11:27:37 +01:00
* Python ≥ 3.9
* Docker CLI available and configured
* Sufficient permissions to remove Docker volumes
(usually requires `root` or membership in the `docker` group)
2025-04-07 14:47:10 +02:00
---
2025-12-28 11:27:37 +01:00
## 📜 License
2025-04-07 14:47:10 +02:00
2025-12-28 11:27:37 +01:00
This project is licensed under the **MIT License ** .
2025-04-07 14:47:10 +02:00
---
## 👤 Author
2025-12-28 11:27:37 +01:00
**Kevin Veen-Birkenbach**
2025-04-07 14:47:10 +02:00
🌍 [https://www.veen.world/ ](https://www.veen.world/ )
2025-12-28 11:27:37 +01:00
```