A python library for ineracting with container images and container image registries
Project description
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
# Initialize a ContainerImage given a tag reference
my_image = ContainerImage("registry.k8s.io/pause:3.5")
# Display some basic information about the container image
print(
f"Size of {str(my_image)}: " + \
my_image.get_size_formatted(auth={}) # 499.91 MB
)
print(
f"Digest for {str(my_image)}: " + \
my_image.get_digest(auth={}) # sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07
)
# Inspect the container image image for a more consolidated summary
print(
f"Inspect for {str(my_image)}:\n" + \
str(my_image.inspect(auth={})) # Same as skopeo inspect docker://registry.k8s.io/pause:3.5
)
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
- Clone this repository
- Build the project from source
- Locate the
.whl(wheel) file in thedistfolder- It should be named something like so:
containerimage_py-1.1.1-py3-none-any.whl
- It should be named something like so:
- Run the following command from the root of the repository, replacing the name of the
.whlfile if necessarypip install dist/containerimage_py-1.1.1-py3-none-any.whl
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.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file containerimage_py-1.1.1.tar.gz.
File metadata
- Download URL: containerimage_py-1.1.1.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d137ee9d286ad34ed127edd740ec9bf00a631d7b5c6269fd0a466a1223dc8f5
|
|
| MD5 |
bb011ff778895f9b9f77b0e3313f29f2
|
|
| BLAKE2b-256 |
bc2dfb09a61d90a2a88917f20a6ff9530bdc722b0a095682a56773c9c25a15a5
|
File details
Details for the file containerimage_py-1.1.1-py3-none-any.whl.
File metadata
- Download URL: containerimage_py-1.1.1-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
496310d852ec6fc39d076e5566baf3705b413074c26a6f39fedf5046610e4170
|
|
| MD5 |
7844458bafd6d9b1c00e5a0eccfb1156
|
|
| BLAKE2b-256 |
60ac2e7b7dc39711fc7f385c101b419fce1eb78bc4f53d00b33e66368d02612a
|