
containerimage-py

A python library for interacting with container images and container image registries
Docs: https://containers.github.io/containerimage-py/
Contributing: CONTRIBUTING.md
Quick Example
Here is a quick motivating example for how you might use containerimage-py
in your python scripts to fetch basic information about a container image.
from image.containerimage import ContainerImage
my_image = ContainerImage("registry.k8s.io/pause:3.5")
print(
f"Size of {str(my_image)}: " + \
my_image.get_size_formatted(auth={})
)
print(
f"Digest for {str(my_image)}: " + \
my_image.get_digest(auth={})
)
To run this example, simply execute the following from the root of this repository
python3 examples/quick-example.py
Installation
Using Pip
Run the following command to install the latest version of this package
pip install containerimage-py
Local Install
Build
From the root of this repository, execute
make build
Under the hood, this will execute python3 -m build
and produce a .whl
(wheel) and .tgz
(TAR-GZip archive) file in the dist
subdirectory. For more on this project's make recipes, see CONTRIBUTING.md.