Skip to main content

A tool for analyzing Dockerfiles and Docker images

Project description

🐳 DClean

License Version

⭐ 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.2

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

Terminal Output

Save results to a file:

dclean analyze dockerfiles/Dockerfile --deep --output examples/file_output.txt

📄 View sample output file

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

  1. Fork the repository on GitHub
  2. Clone your fork to your local machine
  3. Create a new branch from the dev branch for your feature or bugfix
  4. Make your changes and commit them with descriptive messages
  5. Push your branch to your GitHub fork
  6. Open a pull request from your branch to the dev branch 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mist_dclean-0.1.2.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mist_dclean-0.1.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file mist_dclean-0.1.2.tar.gz.

File metadata

  • Download URL: mist_dclean-0.1.2.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

Hashes for mist_dclean-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2646416d3120093482d791912c7004fdc81daf85d266e00fc1f6498e57e81c0d
MD5 af142fd46bd1730f42f0295f77777399
BLAKE2b-256 05c81ab2e7b01b20d585158cc2daad77214ee5c688103335bd053959557ed93d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mist_dclean-0.1.2.tar.gz:

Publisher: publish.yml on mist941/dclean

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mist_dclean-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mist_dclean-0.1.2-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

Hashes for mist_dclean-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 265a1d997983e06b45e8bd1c06ddcd69294bfbe76a86e10b6e261d56868e3dbe
MD5 cb21c233d32b0c283a3e06e840462450
BLAKE2b-256 0071413dc7ca9df1581238f194da1922288dbd42f51c69980d548dde09726564

See more details on using hashes here.

Provenance

The following attestation bundles were made for mist_dclean-0.1.2-py3-none-any.whl:

Publisher: publish.yml on mist941/dclean

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page