Skip to main content

A lightweight to tool to analyse and compare Docker images instantly, focusing on layer analysis

Project description

Docker Analyzer CLI

Finally a lightweight tool to inspect and compare Docker images instantly, focusing on layer analysis.

Overview

Docker Analyzer CLI is a Python-based command-line interface designed to analyze and compare Docker images. It provides quick insights into image layers, size optimizations, and differences, making it an essential tool for developers and DevOps engineers.

Features

  • Layer Analysis: Inspect Docker image layers to identify redundancies or inefficiencies.
  • Image Comparison: Compare two images to find shared, duplicated, or non-shared layers.
  • CLI Interface: A powerful and flexible command-line interface.
  • Web GUI Integration: Optionally launch a web-based interface for interactive analysis.
  • Custom Configuration: Configure temporary directories, logging, and output formats.

Installation

  1. Clone the repository:

    git clone https://github.com/gianfa/docker_analyzer.git
    
  2. Navigate to the project directory:

    cd docker-inspector
    
  3. Install the tool using Poetry:

    poetry install
    

    For global CLI availability:

    poetry build
    pip install dist/docker_analyzer-*.whl
    

CLI Usage

Getting Help

To view all available commands and options:

docker_analyzer --help

Common Commands

Get Temporary Directory

Displays the temporary directory used for file storage:

docker_analyzer get-temp-dir

List Docker Images

Lists all Docker images available on the system:

docker_analyzer list-images

Launch Web GUI

Starts the web-based graphical interface:

docker_analyzer web-gui

Navigate to http://localhost:5002 in your browser to use the GUI.

Comparison Examples

Compare Shared Layers

Identify layers that are shared between two images:

docker_analyzer compare shared-layers python:3.9-slim python:3.9

Compare Duplicated Layers

Find duplicated layers within an image or across two images:

docker_analyzer compare duplicated-layers python:3.9-slim python:3.9

Compare Non-Shared Layers

Identify layers unique to each image:

docker_analyzer compare non-shared-layers python:3.9-slim python:3.9

Compare Total Sizes

Compare the total sizes of two images:

docker_analyzer compare total-sizes python:3.9-slim python:3.9

Development

Running Tests

Run all tests using pytest:

poetry run pytest

Code Style

The project adheres to PEP 8. Check code formatting using black:

poetry run black .

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request with a detailed description.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

docker_analyzer-0.1.0.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

docker_analyzer-0.1.0-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docker_analyzer-0.1.0.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.14 Darwin/24.1.0

File hashes

Hashes for docker_analyzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 beecf4305af8c6a75c113367a862540c63ca49660b0fb6c41898c71921b1f583
MD5 26c97216609e6fa4fbd743cef0c7e55c
BLAKE2b-256 67f27945067804f6374b3cfed1c6310a33223728b43aeb5b4427875cc9c85cff

See more details on using hashes here.

File details

Details for the file docker_analyzer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: docker_analyzer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.14 Darwin/24.1.0

File hashes

Hashes for docker_analyzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a103ce131be90145518dced6b6dabc380542621dc116023f0cdf5ac66d2052e0
MD5 19ffc557a1e048d4bdf0dddec7d3752e
BLAKE2b-256 289acf8f5075eab71083eeae2da55f753a7380aecceab1b1aca0067d2933e6e0

See more details on using hashes here.

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