⭐ If you find this project useful, please consider giving it a star to show your support!
DClean is a powerful tool for analyzing Docker images and Dockerfiles. DClean leverages Trivy for comprehensive vulnerability scanning and provides actionable recommendations to optimize your Dockerfile instructions, helping you create leaner, faster, and more secure containers.
- Docker installed on your system
- Python 3.10 or higher
- pip (Python package manager)
pip install mist.dclean
git clone https://github.com/mist941/dclean.git
cd dclean
pip install -e .
dclean version
You should see the following output:
dclean version 0.1.2
dclean analyze path/to/Dockerfile
Save analysis results to a file:
dclean analyze path/to/Dockerfile --output path/to/output.txt
Perform deep analysis (includes vulnerability scanning):
dclean analyze path/to/Dockerfile --deep
Deep analysis with colored output in terminal:
dclean analyze dockerfiles/Dockerfile --deep
Save results to a file:
dclean analyze dockerfiles/Dockerfile --deep --output examples/file_output.txt
The DClean project is organized as follows:
dclean/
├── main.py # CLI entry point
├── analyze # Analyze Dockerfiles and Docker images
├── utils # Utility functions
├── api # API for analyzing Docker images
└── tests # Tests
DClean is built using the following technologies and tools:
- Python 3.10+: Core programming language
- Click: Command-line interface creation
- Docker SDK for Python: Interacting with Docker API
- Trivy: Vulnerability scanning for container images
- pytest: Testing framework
- flake8: Linting
- Ivan Statkevich - Initial work - mist941
This project is maintained by Ivan Statkevich. Feel free to reach out with questions or feedback.
🤝 Contributions are welcome! Feel free to open issues and submit pull requests.
- Fork the repository on GitHub
- Clone your fork to your local machine
- Create a new branch from the
dev
branch for your feature or bugfix - Make your changes and commit them with descriptive messages
- Push your branch to your GitHub fork
- Open a pull request from your branch to the
dev
branch of the main repository
If you find a bug or have a feature request, please open an issue on GitHub with:
- A clear, descriptive title
- A detailed description of the issue or feature
- Steps to reproduce (for bugs)
- Any relevant logs or screenshots