A tool for analyzing Dockerfiles and Docker images
Project description
🐳 DClean
⭐ If you find this project useful, please consider giving it a star to show your support!
Table of Contents
Description
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.
Installation
Prerequisites
- Docker installed on your system
- Python 3.10 or higher
- pip (Python package manager)
Option 1: Install from PyPI
pip install mist.dclean
Option 2: Install from Source
git clone https://github.com/mist941/dclean.git
cd dclean
pip install -e .
Verify Installation
dclean version
You should see the following output:
dclean version 0.1.1
Usage
Analyze a Dockerfile:
dclean analyze path/to/Dockerfile
Analysis Options
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
Examples
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
Project Structure
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
Technologies
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
Authors
- Ivan Statkevich - Initial work - mist941
This project is maintained by Ivan Statkevich. Feel free to reach out with questions or feedback.
Contributing
🤝 Contributions are welcome! Feel free to open issues and submit pull requests.
Getting Started
- Fork the repository on GitHub
- Clone your fork to your local machine
- Create a new branch from the
devbranch 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
devbranch of the main repository
Reporting Issues
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
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 mist_dclean-0.1.1.tar.gz.
File metadata
- Download URL: mist_dclean-0.1.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81c036e3fa08bd9241e578e2efe0c5473b52bd0210b2843519dea4141526d60b
|
|
| MD5 |
a481e2feb0258eba015e32481b05523e
|
|
| BLAKE2b-256 |
a8401d0765051b0f49d9682c8c8c4f50ee84e95d0a6d59ac0d4d2c910d3368fe
|
Provenance
The following attestation bundles were made for mist_dclean-0.1.1.tar.gz:
Publisher:
publish.yml on mist941/dclean
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mist_dclean-0.1.1.tar.gz -
Subject digest:
81c036e3fa08bd9241e578e2efe0c5473b52bd0210b2843519dea4141526d60b - Sigstore transparency entry: 179442148
- Sigstore integration time:
-
Permalink:
mist941/dclean@0c52bd165a7ce61091036eee1466bcdc87efba0c -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/mist941
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0c52bd165a7ce61091036eee1466bcdc87efba0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file mist_dclean-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mist_dclean-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15b3c120d277fcaa917de5fbdfe4f430383b90f51dee2ad45695691d948d5e8c
|
|
| MD5 |
f8c62354917420ecb00e550b03394033
|
|
| BLAKE2b-256 |
413c257e8a6cce4d3ac4868befccbb21e7b0460d1c2623a993d52bef84e61572
|
Provenance
The following attestation bundles were made for mist_dclean-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on mist941/dclean
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mist_dclean-0.1.1-py3-none-any.whl -
Subject digest:
15b3c120d277fcaa917de5fbdfe4f430383b90f51dee2ad45695691d948d5e8c - Sigstore transparency entry: 179442149
- Sigstore integration time:
-
Permalink:
mist941/dclean@0c52bd165a7ce61091036eee1466bcdc87efba0c -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/mist941
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0c52bd165a7ce61091036eee1466bcdc87efba0c -
Trigger Event:
release
-
Statement type: