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 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.0

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.0.tar.gz (14.5 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.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mist_dclean-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 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.0.tar.gz
Algorithm Hash digest
SHA256 774d83148d28c6bd6f46c27b68e2408433fd810ab2862b9e58af985993f8453f
MD5 7558cf9e42d6317f8d8151bb437cb3cc
BLAKE2b-256 9aeb885d40f2b4f60e41677595f8ce1e6860c85cbf89e776de7bc85d117eecb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mist_dclean-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: mist_dclean-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 461e2427b6f6bae5dc3c627d1a37176ed891e9b2d19a3d4fa8c1c0f87f84e2ec
MD5 0fabc7dc325e889e8618aee92c80aa7a
BLAKE2b-256 b3ba45249769dc42db8d19000ebcf706c68800b9049a0a9d333e124cdbdb07fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for mist_dclean-0.1.0-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