Python-first Dockerfile optimizer CLI
Project description
docker-opt
Python-first Dockerfile optimization advisor for DevOps teams. It analyzes a Dockerfile, flags risks and bloat, outputs JSON for CI, generates an optimized Python template, and suggests a .dockerignore.
Install
pip install docker-opt
Windows exe build
.\build.ps1
dist\docker-opt.exe --help
Usage
# Analyze
python -m docker_opt analyze -f Dockerfile
# JSON output
python -m docker_opt analyze -f Dockerfile --json
# CI: fail on MEDIUM and HIGH findings
python -m docker_opt analyze -f Dockerfile --ci --fail-on MEDIUM
# Generate an optimized template
python -m docker_opt fix -f Dockerfile --stdout
# Suggest .dockerignore
python -m docker_opt dockerignore --type python
Scoring
Each finding includes severity and an impactBand to help triage (e.g., SECURITY, SIZE, CACHE, REPRODUCIBILITY).
Roadmap
PR comment bot integration for CI feedback.
Build & Publish to PyPI
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
pytest
python -m build
python -m twine check dist\*
Publish (TestPyPI by default):
setx TWINE_USERNAME "__token__"
setx TWINE_PASSWORD "pypi-***"
.\publish.ps1
Publish to PyPI:
.\publish.ps1 -Target prod
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 docker_opt-0.1.0.tar.gz.
File metadata
- Download URL: docker_opt-0.1.0.tar.gz
- Upload date:
- Size: 17.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47182bd4a5d131d8092ea0b3c85ff1d3f5185cb249832cb042d5cf0c4b91a106
|
|
| MD5 |
7da6c80c53c1ca0edb8f6936435711ba
|
|
| BLAKE2b-256 |
f64020e79b8c523e50be0006ae4d41d1ae579b7ad7345e5394d9075d2806c7fc
|
File details
Details for the file docker_opt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docker_opt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
767f41b6f3fab3b7245eaa5f379904e4e15f9a98b155bc97a46fcdd2a422a346
|
|
| MD5 |
154c77a4e6f1ef587cf46f8553869619
|
|
| BLAKE2b-256 |
65c3cff528843f73d426dd5ecdbc4249935f3e7db845ac3cf43fa3dfbc539670
|