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.1.tar.gz (36.7 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.1-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docker_analyzer-0.1.1.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for docker_analyzer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 86021378b0f4ce407f7580060d32274b32ad6f46f1ebc8bb42729374fa92100d
MD5 4c90fabfd17847a3737154f1c21e122c
BLAKE2b-256 682d3857ff328907f269c1d5d0adc08482ff6ef1fcf59f9b0e4dcc4b2f5617f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for docker_analyzer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c9d776a60fa8bab263f9681e69959a577674ce1698840d4c375c583562e978
MD5 6635fa672ca5feebaf6181b6ddc523a0
BLAKE2b-256 1e96de63a119f6f6ad9a6db13500ca1a2c9cddd48c582901b7ccaff53d005eae

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