container-inspector
Docker, containers, rootfs and virtual machine related software composition analysis (SCA) utilities.
What it is and what it does
container-inspector is a command-line and Python library suite for analyzing Docker images saved in the standard `docker save` format. It reads the layered structure of Docker images, parses their metadata, extracts Dockerfiles, and reconstructs what a runtime rootfs would look like by stacking layers according to AUFS conventions (including whiteout file handling). It also detects the Linux distribution of a rootfs using os-release files and can collect package and file inventories from images or layers using pluggable callable handlers.
The package is built on four runtime dependencies: click for CLI scaffolding, attrs for data modeling, dockerfile_parse for Dockerfile analysis, and commoncode for shared utilities. It targets modern Python (3.10+) on POSIX systems and is classified as production-stable, though its maintenance cadence has slowed.
Use it for:
- Extract and analyze the layer structure of Docker images to understand how they were built and what files changed between layers.
- Parse Dockerfiles and correlate them with actual saved Docker images to trace the relationship between build instructions and runtime artifacts.
- Collect software package inventories from container images for supply-chain analysis or vulnerability scanning workflows.
- Detect the base operating system and architecture of a container rootfs to support compatibility or compliance checks.
- Reconstruct a flattened view of a container's runtime filesystem by layering saved image archives according to AUFS semantics.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Analyzes Docker images, containers, and virtual machine images to extract metadata, layers, Dockerfiles, and package inventories from saved image archives.
Yes, if you need to analyze Docker images offline or programmatically. The package is stable, has low install friction, and solves a specific problem (Docker image forensics and composition analysis) that few other tools address directly. The aging maintenance status and 205-day release gap are minor concerns for a tool focused on stable image format handling. No known vulnerabilities. Not worth installing if you only need to fetch images from registries or scan for vulnerabilities—those are handled by related tools (ScanCode.io, ScanCode Toolkit).
Install
container-inspector on PyPI
pip
pip install container-inspectoruv
uv add container-inspectorpoetry
poetry add container-inspectorInstalling container-inspector
Before you install
Low friction: pure Python wheel with four straightforward runtime dependencies (click, attrs, dockerfile_parse, commoncode). Last release was 205 days ago; repo is active and not archived, though maintenance pace is aging.
License in practice
Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions; you must retain license and copyright notices.
Quickstart
pip install container-inspector
from container_inspector.image import Image
img = Image('path/to/saved/image.tar')
for layer in img.layers:
print(layer.metadata)
Requires POSIX operating system (Linux, macOS); does not run on Windows. Requires Python 3.10 or later.
Verify before relying
- Whether the package can parse OCI image layout format (described as 'in progress' in the description but not confirmed as implemented)
- Actual performance and memory footprint when processing large container images
- Whether Windows container support mentioned as 'improved' in plans has been implemented
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — click, attrs, dockerfile_parse, commoncode |
| Maintenance | aging — 205 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 124,907/month — #11,847 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: container_inspector-33.1.0-py3-none-any.whl
Keywords: utilities, docker, container, oci, qcow, os-release, virtual-machine, vm, rootfs, scancode
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
azure-containerregistryClient library for managing container images,…
permissive · top 5,000 on PyPI
docker-squashCombines multiple Docker image layers into…
permissive · top 15,000 on PyPI
dockerfileParses Dockerfile syntax into structured Python…
permissive · top 15,000 on PyPI
pytest-containerA pytest plugin that automates container…
copyleft · top 15,000 on PyPI
exasol-integration-test-docker-environmentProvides a CLI and Python API to start and…
permissive · top 15,000 on PyPI
opentelemetry-resourcedetector-dockerExtracts Docker container metadata and…
permissive · top 5,000 on PyPI
tox-dockerA tox plugin that manages Docker container…
permissive · top 15,000 on PyPI
psd-toolspsd-tools reads and writes Adobe Photoshop…
permissive · top 15,000 on PyPI
scancode-toolkitScanCode Toolkit detects licenses, copyrights,…
permissive · top 15,000 on PyPI
ipsw-parserParses and extracts data from iOS IPSW firmware…
copyleft · top 15,000 on PyPI