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

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.1.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.1-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

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

Hashes for mist_dclean-0.1.1.tar.gz
Algorithm Hash digest
SHA256 81c036e3fa08bd9241e578e2efe0c5473b52bd0210b2843519dea4141526d60b
MD5 a481e2feb0258eba015e32481b05523e
BLAKE2b-256 a8401d0765051b0f49d9682c8c8c4f50ee84e95d0a6d59ac0d4d2c910d3368fe

See more details on using hashes here.

Provenance

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

Hashes for mist_dclean-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15b3c120d277fcaa917de5fbdfe4f430383b90f51dee2ad45695691d948d5e8c
MD5 f8c62354917420ecb00e550b03394033
BLAKE2b-256 413c257e8a6cce4d3ac4868befccbb21e7b0460d1c2623a993d52bef84e61572

See more details on using hashes here.

Provenance

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