Skip to content

ash-thakur-rh/inspect

Repository files navigation

Inspect - Podman Desktop Extension

A powerful Podman Desktop extension for deeply inspecting container images, exploring layer structure, analyzing file systems, and measuring space efficiency - inspired by dive.

License TypeScript Podman Desktop

Features

πŸ” Layer-by-Layer Analysis

Explore each image layer in detail and understand exactly what changed at each step of your image build.

πŸ“Š Space Efficiency Metrics

Get a comprehensive efficiency score and identify wasted space in your container images. Discover:

  • Total image size
  • Wasted space from deleted or modified files
  • Efficiency score (0-100%)
  • Duplicated files across layers

πŸ“ File System Insights

Track file changes across layers:

  • Files added in each layer
  • Files modified from previous layers
  • Files removed (but still consuming space)
  • Size contribution per layer

πŸ’‘ Smart Recommendations

Receive actionable suggestions to optimize your images:

  • Combine layers to reduce overhead
  • Clean up temporary files in the same layer
  • Use multi-stage builds for smaller images
  • Identify large layers that need attention

🎨 Interactive UI

Beautiful, responsive web-based interface with:

  • Expandable layer details
  • Color-coded efficiency indicators
  • Real-time metrics visualization
  • Easy-to-read file statistics

Screenshots

Coming soon - Screenshots of the extension in action

Installation

From Source

  1. Clone the repository:

    git clone https://github.com/ash-thakur-rh/inspect.git
    cd inspect
  2. Install dependencies and build:

    npm install
    npm run build
  3. Install in Podman Desktop:

    • Open Podman Desktop
    • Go to Settings β†’ Extensions
    • Click "Install extension from folder"
    • Select the inspect directory
    • The extension will be loaded and activated

From Release (Coming Soon)

Download the latest release and install directly in Podman Desktop.

Usage

Basic Usage

  1. Open Podman Desktop
  2. Navigate to the Images view
  3. Find the image you want to analyze
  4. Click the "Inspect Layers" menu item for that image
  5. Wait for the analysis to complete
  6. Explore the results in the webview panel

Understanding Results

Efficiency Score

  • 90-100%: 🟒 Excellent - well-optimized image
  • 80-89%: 🟑 Good - minor optimizations possible
  • 60-79%: 🟠 Fair - consider optimization
  • <60%: πŸ”΄ Poor - significant optimization needed

Layer Information

Click on any layer to see:

  • Number of files added, modified, and removed
  • Layer size and wasted space
  • The command that created the layer
  • Creation timestamp

Recommendations

The extension provides specific suggestions based on your image structure:

  • Combine multiple RUN commands
  • Remove package manager caches
  • Use multi-stage builds
  • Clean up temporary files

Development

Prerequisites

  • Node.js 20 or higher
  • npm 9 or higher
  • Podman Desktop installed

Setup

# Install dependencies
npm install

# Build the extension
npm run build

# Watch mode for development (auto-rebuild on changes)
npm run watch

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Check code formatting
npm run format:check

# Fix code formatting
npm run format:fix

Project Structure

inspect/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ extension.ts              # Main entry point
β”‚   β”œβ”€β”€ types/                    # TypeScript interfaces
β”‚   β”œβ”€β”€ analyzers/                # Image and layer analysis
β”‚   β”‚   β”œβ”€β”€ image-analyzer.ts
β”‚   β”‚   β”œβ”€β”€ layer-analyzer.ts
β”‚   β”‚   β”œβ”€β”€ filesystem-parser.ts
β”‚   β”‚   └── efficiency-calculator.ts
β”‚   β”œβ”€β”€ ui/                       # UI components
β”‚   β”‚   └── inspect-panel.ts
β”‚   └── utils/                    # Utility functions
β”œβ”€β”€ dist/                         # Compiled output
β”œβ”€β”€ package.json                  # Extension manifest
└── README.md

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Roadmap

See DEVELOPMENT.md for detailed architecture and upcoming features.

Comparison with dive

Feature Inspect dive
Podman Desktop Integration βœ… ❌
Web-based UI βœ… ❌ (Terminal UI)
Layer Analysis βœ… βœ…
File System Browser βœ… βœ…
Efficiency Metrics βœ… βœ…
CI Integration 🚧 Planned βœ…
Interactive Layer Diff 🚧 Planned βœ…

Legend: βœ… Implemented | 🚧 Planned | ❌ Not Available

Examples

See examples/EXAMPLES.md for detailed usage examples and optimization strategies.

Quick Example

Before optimization:

FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
COPY app.py /app/

Efficiency: 65%, Wasted: 180MB

After optimization:

FROM ubuntu:22.04
RUN apt-get update && \
    apt-get install -y python3 python3-pip && \
    rm -rf /var/lib/apt/lists/*
COPY app.py /app/

Efficiency: 92%, Wasted: 12MB

Roadmap

Version 0.1.0

  • [βœ”]: MVP features
  • [βœ”] Real tar archive extraction from layers
  • [βœ”] Interactive file tree browser

Version 0.2.0

  • Layer diff visualization
  • Export reports (JSON, CSV, HTML)

Version 0.3.0

  • Caching for analyzed layers
  • Comparison between multiple images
  • Historical analysis tracking
  • Performance optimizations

Version 1.0.0

  • CI integration mode
  • Custom efficiency rules
  • Plugin system for analyzers
  • Multi-platform support

Troubleshooting

Extension won't load

  • Ensure you've built the extension: npm run build
  • Check that dist/extension.js exists
  • Look for errors in Podman Desktop's developer console

Analysis fails

  • Verify the image exists: podman images
  • Check Podman Desktop logs for errors
  • Ensure you have permission to access the image

UI doesn't display

  • Check browser console in the webview
  • Ensure webview has enableScripts: true
  • Try reloading the extension

FAQ

Q: Does this work with Docker images? A: Yes! It works with any OCI-compliant container image.

Q: Can I use this in CI/CD pipelines? A: Not yet, but CLI support is planned for future releases.

Q: How accurate are the efficiency scores? A: The scores are based on layer size analysis and file change tracking. Actual optimization results may vary.

Q: Does this modify my images? A: No, the extension is read-only and only analyzes existing images.

Resources

License

Apache License 2.0 - see LICENSE for details

Acknowledgments

  • Inspired by dive by Alex Goodman
  • Built for Podman Desktop
  • Thanks to the Podman Desktop team for the extension API

Support

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors