CLI tool for managing Docker container cleanups
Project description
Docker Tools Plus
A command-line tool for managing Docker container cleanups using predefined regular expression patterns.
Features
- 🐳 Create named cleanup configurations with regular expressions
- 🗑️ Clean containers, volumes, and images matching patterns
- 💾 SQLite database for persistent configuration storage
- 🔍 Interactive prompts for multiple matches
- 🛡️ Safety confirmations before destructive operations
Installation
- Install using uv:
uv pip install git+https://github.com/yourusername/docker-tools-plus.git
- Verify installation:
docker-tools-plus --help
Usage
Create and Execute Cleanup
docker-tools-plus clean <name>
Example flow:
$ docker-tools-plus clean reconciliation
No cleanup found matching 'reconciliation'
Please enter a regular expression: reconciliation[a-z_]*_postgres
Created new cleanup config:
ID: 1 | Name: reconciliation | Pattern: reconciliation[a-z_]*_postgres
Clean containers? [Y/n]: y
Clean volumes? [Y/n]: y
Clean images? [Y/n]: y
List All Cleanups
docker-tools-plus list
Output:
1: reconciliation - reconciliation[a-z_]*_postgres
2: temp-containers - temp_.+
Delete a Cleanup
docker-tools-plus delete <name>
Example:
$ docker-tools-plus delete temp
Multiple matches found:
1: temp-containers
2: temp-images
Enter the ID to delete: 1
Delete cleanup 'temp-containers' (ID: 1)? [y/N]: y
Show Info
docker-tools-plus about
Output:
docker-tools-plus v0.1.0
Database location: /path/to/cleanups.db
CLI tool for managing Docker container cleanups
Configuration
Create configuration.toml to customize:
[database]
path = "custom_cleanups.db"
Development
# Install dev dependencies
uv pip install -e '.[dev]'
# Run tests
make test
# Generate coverage report
make cov
# Lint code
make lint
Database Management
The default application path is ~/.config/docker-tools-plus/.
This path will probably not work on Windows, so you can specify a custom path in configuration.toml:
The SQLite database is automatically created at:
- Default:
docker_tools_plus.db - Custom: Path specified in
configuration.toml
Safety Features
- Confirmation Prompts for destructive operations
- Separate Resource Types (containers/volumes/images)
- Force Mode (use with caution):
docker-tools-plus clean <name> --force
⚠️ Warning: Regular expressions are powerful - test patterns with docker ps -a/docker volume ls/docker image ls before creating cleanup configurations.
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
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 docker_tools_plus-0.4.2.tar.gz.
File metadata
- Download URL: docker_tools_plus-0.4.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13e14eabf61495225afeac46f1dd632ad3a7ccb137d3299b7d4b3cbfe4e376b2
|
|
| MD5 |
2a4d23299e143b8051bfebe046447d09
|
|
| BLAKE2b-256 |
7f65c89abf5356f4cf49fdd3c90001b7e59c828a53993b72b7acf8d0095f1ab6
|
File details
Details for the file docker_tools_plus-0.4.2-py3-none-any.whl.
File metadata
- Download URL: docker_tools_plus-0.4.2-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bff5f124b0c608f54ba8a3c542180056d95d56c0f35e56d381e70c82ee562d4
|
|
| MD5 |
750da6550812217b094c912be6a42337
|
|
| BLAKE2b-256 |
162e78368c2940243121faa636bd32ac488e2b04774beb045bbc22631ca467a7
|