aioregistry-0.7.0
توضیحات
Python library for interacting with container image registries
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aioregistry-0.7.0 |
| نام | aioregistry |
| نسخه کتابخانه | 0.7.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Mark Gordon |
| ایمیل نویسنده | msg555@gmail.com |
| آدرس صفحه اصلی | http://github.com/msg555/aioregistry |
| آدرس اینترنتی | https://pypi.org/project/aioregistry/ |
| مجوز | - |
pyregistry
pyregistry is a Python library and CLI tool for inspecting and copying container image data
from and between registries.
This library primarily focuses on being a useful tool for dealing with container image
registries. It has very limited support for interpretation of the objects stored within.
# Library usage
## Find sub-manifest based on platform.
```python
async with AsyncRegistryClient() as client:
manifest_ref = parse_image_name("alpine")
manifest = await client.manifest_download(manifest_ref)
if isinstance(manifest, ManifestListV2S2):
for sub_manifest in manifest.manifests:
if sub_manifest.platform.architecture == "amd64":
manifest_ref.ref = sub_manifest.digest
manifest = await client.manifest_download(manifest_ref)
break
else:
raise Exception("Found no matching platform")
else:
print("Not a manifest list")
```
## Download layers of an image
```python
for layer in manifest.layers:
assert layer.media_type == "application/vnd.docker.image.rootfs.diff.tar.gzip"
blob_ref = RegistryBlobRef(manifest_ref.registry, manifest_ref.repo, layer.digest)
# For example we just download into memory. In practice don't do this.
blob_data = io.BytesIO(
b"".join([chunk async for chunk in client.ref_content_stream(blob_ref)])
)
with tarfile.open(mode="r|*", fileobj=blob_data) as tar:
for tarinfo in tar.getmembers():
print(tarinfo.name)
```
# CLI copy tool
```sh
# By default it will pull credentials based on ~/.docker/config.json
python -m aioregistry ubuntu:18.04 my.private.registry/my-repo:my-tag
```
```sh
# Copy all tags matching regex
python -m aioregistry ubuntu my.private.registry/my-repo --tag-pattern '18\..*'
نیازمندی
| مقدار | نام |
|---|---|
| <4,>=3.8 | aiohttp |
| <2,>=1.8 | pydantic |
| - | typing-extensions |
| >=4.20.0<5 | tqdm |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aioregistry-0.7.0:
pip install aioregistry-0.7.0.whl
نصب پکیج tar.gz aioregistry-0.7.0:
pip install aioregistry-0.7.0.tar.gz