docker-registry-client-async
Overview
An AIOHTTP based Python REST client for the Docker Registry.
Getting Started
import asyncio
import json
from docker_registry_client_async import DockerRegistryClientAsync, FormattedSHA256, ImageName, Manifest
async def get_config(drca: DockerRegistryClientAsync, image_name: ImageName, manifest: Manifest) -> bytes:
config_digest = FormattedSHA256.parse(manifest.get_json()["config"]["digest"])
result = await drca.get_blob(image_name, config_digest)
return json.loads(result["blob"].decode("utf-8"))
async def get_manifest(drca: DockerRegistryClientAsync, image_name: ImageName) -> Manifest:
result = await drca.get_manifest(image_name)
return result["manifest"]
async def main():
image_name = ImageName.parse("busybox:1.30.1")
async with DockerRegistryClientAsync() as drca:
manifest = await get_manifest(drca, image_name)
config = await get_config(drca, image_name, manifest)
print(config)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Installation
From pypi.org
$ pip install docker_registry_client_async
From source code
$ git clone https://github.com/crashvb/docker-registry-client-async
$ cd docker-registry-client-async
$ virtualenv env
$ source env/bin/activate
$ python -m pip install --editable .[dev]
Environment Variables
| Variable | Default Value | Description |
|---|---|---|
| DRCA_CACERTS | The path to the certificate trust store. | |
| DRCA_CHUNK_SIZE | 2097152 | The chunk size to use then replicating content. |
| DRCA_CREDENTIALS_STORE | ~/.docker/config.json | The credentials store from which to retrieve registry credentials. |
| DRCA_DEBUG | Adds additional debug logging, mainly for troubleshooting and development. | |
| DRCA_DEFAULT_REGISTRY | index.docker.io | The default registry index to use when resolving image names. |
| DRCA_DEFAULT_NAMESPACE | library | The default registry namespace to use when resolving image names. |
| DRCA_DEFAULT_TAG | latest | The default image tag to use when resolving image names. |
| DRCA_PROTOCOL | https | The default transport protocol to when communicating with a registry. |
Development
Metadata
Release files for docker-registry-client-async 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docker_registry_client_async-1.0.3.tar.gz | 46.1 kB | Without provenance | Details for docker_registry_client_async-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docker_registry_client_async-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for docker_registry_client_async-1.0.3-py3-none-any.whl |
Total release size: 99.5 kB
Release files / docker_registry_client_async-1.0.3.tar.gz
| Download URL | docker_registry_client_async-1.0.3.tar.gz |
|---|---|
| Size | 46.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dca2d937870b03b25e2ec036627755c81412c3b725b1a3ececb51a9b062d858a
|
|
BLAKE2b-256 checksum How to use checksums |
f394598cd08395f9747197aaec93bea948430dd6431a386dc479c75b0d37ac71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.4
|
Release files / docker_registry_client_async-1.0.3-py3-none-any.whl
| Download URL | docker_registry_client_async-1.0.3-py3-none-any.whl |
|---|---|
| Size | 53.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fafcf5140094811de03605b384c203d0137321a96b6d194f7fde9c20a06a973
|
|
BLAKE2b-256 checksum How to use checksums |
d4b200dddfe340ba731d720e5c04000859a2582e49e74a913ae618be4bd550bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.4
|
Security for docker-registry-client-async 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.