Skip to main content

Docker Tools Plus

PyPI version

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

  1. Install using uv:
uv pip install git+https://github.com/yourusername/docker-tools-plus.git
  1. Verify installation:
docker-tools-plus --help

Usage

Create and Execute Cleanup

docker-tools-plus clean <name> [--force]
  • Use --force to skip all confirmation prompts
  • Automatically cleans all resource types without asking

Example flow without --force:

$ 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

Example with --force:

$ docker-tools-plus clean reconciliation --force
Created new cleanup config:
ID: 1 | Name: reconciliation | Pattern: reconciliation[a-z_]*_postgres
Cleaning containers... done
Cleaning volumes... done
Cleaning images... done

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

Displays application information in a formatted panel with:

  • Application name and version (centered)
  • Database location with file existence indicator (✓ if exists, ✗ if missing)
  • Description

Example panel:

┌ About ───────────────────────────────────────────────────┐
│                                                          │
│             docker-tools v0.4.2                          │
│                                                          │
│  Database location: /path/to/cleanups.db ✓               │
│                                                          │
│  CLI tool for managing Docker container cleanups          │
│                                                          │
└──────────────────────────────────────────────────────────┘

Reset Database

docker-tools-plus reset

Creates a timestamped backup of the current database and creates a new blank one. Requires confirmation unless --force is used.

Example:

$ docker-tools-plus reset
This will rename your current database and create a new blank one. Continue? [y/N]: y
Renamed existing database to cleanups_20240614_123456.db
Created new blank database successfully.

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

  1. Confirmation Prompts for destructive operations
    • Always asks before cleaning each resource type (containers/volumes/images)
    • Can be skipped with --force option
  2. Separate Resource Types (containers/volumes/images)
  3. Force Mode (use with caution):
    • Skips all confirmation prompts
    • Automatically cleans all resource types
    • Requires explicit --force flag:
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.

Metadata

Release files for docker-tools-plus 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docker-tools-plus 0.5.1
File Size Uploaded Provenance
docker_tools_plus-0.5.1.tar.gz 9.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for docker-tools-plus 0.5.1
File Interpreter ABI Platform
docker_tools_plus-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / docker_tools_plus-0.5.1.tar.gz

Download URL docker_tools_plus-0.5.1.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2dba7e779ff60c34a0e9be1d7be39e1b0579ad0580fbb5136c57f5dae3223e9c
BLAKE2b-256 checksum
How to use checksums
282b7ee435f8a81e6f778b8930779d3eed4dc5aea0e99adfd79140365fac72ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / docker_tools_plus-0.5.1-py3-none-any.whl

Download URL docker_tools_plus-0.5.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b97d2ae5970cf1eacdce56baf633abfd523f9453db2e02516df3628479758fc
BLAKE2b-256 checksum
How to use checksums
77535bcd238845f40084ea34dcf9ccef2b74b4b97de0a133b52f18f2cf02bedc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for docker-tools-plus 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page