Docker, containers, rootfs and virtual machine related software composition analysis (SCA) utilities.
Project description
container-inspector is a suite of analysis utilities and command line tools for Docker images, containers, root filesystems and virtual machine images.
For Docker images, it can process layers and how these relate to each other as well as Dockerfiles.
container-inspector provides utilities to:
identify Docker images in a file system, its layers and the related metadata.
given a Docker image, collect and report its metadata.
given a Docker image, extract the layers used to rebuild what how a runtime rootfs would look.
find and parse Dockerfiles.
find how Dockerfiles relate to actual images and their layers.
given a Docker image, rootfs or Virtual Machime image collect inventories of packages and files installed in an image or layer or rootfs (implemented using a provided callable)
detect the “distro” of a rootfs of image using os-release files (and an extensive test suite for these)
detect the operating system, architecture and
Quick start
Only runs on POSIX OSes
Get Python 3.6+
Check out a clone or download of container-inspector, then run: ./configure –dev.
Then run env/bin/container-inspector -h for help.
Container image formats
container-inspector handles the formats of Docker images as created by the docker save command. There are three versions for this Docker image format. The latest v1.2 is a minor update to v1.1.
v1.1 provides improved and richer metadata over v1.0 with a top level manifest.json file and a Config file for each image with full layer history and ordeing. It also use checksum for enhanced security and traceability of images and layers.
v1.0 uses a simple repositories meta file and requires infering the ordering of the layers in an image based on each individual layer json meta file. This format is no longer support in the latest version of container-inspector.
All V1.x formats use the same storage format for layers e.g the layer format V1.0 where each layer is stored in a sub-directories named after the layer id. Each of this directories contains a “layer.tar” tarball with the layer payload, a “json” JSON metadata file describing the layer and a “VERSION” file describing the layer format version. Each tarball represents a slice or diff of the image root file system using the AUFS conventions.
At runtime, in a sequence of layers of an image, each root filesystem slice of a layer is “layered” on top of each other from the root bottom layer to the latest layer (or selected tagged layer) using a union file system (e.g. AUFS). In AUFS, any file or directory prefixed with .wh. are “white outs” files deleting files in the underlying layers.
See the image specifications saved in docs/references/
Internal data model
Image: this is a runnable image composed of metadata and a sequence of layers.
Layer: this is a slice of an image root filesystem with a payload and metadata
Resource: this a file or directory
Plans
in progress: support OCI image layout
improved suport for Windows containers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for container-inspector-30.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53ed9193f406a86a85cc4be1a6f18c8d067f0d5143fc9c8a55154a0eb908c0f |
|
MD5 | e302a947a87f5067452a92041825ed77 |
|
BLAKE2b-256 | 986e23bfcc6b074ef8d9d75387831857e9f0735c81b12c03ddeed524fbab7704 |
Hashes for container_inspector-30.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e643616b3a0cf28500f7fb688082b150746ba7742f57c6b6bef325ee01f45258 |
|
MD5 | 50307a667243c476db097b5e4b64ad88 |
|
BLAKE2b-256 | 1d1cdd017a49ad19260cf3a675abc19e4fff17237cc88f1d34b9893beb882f55 |