docker-registry-client-async-0.2.9
توضیحات
An AIOHTTP based Python REST client for the Docker Registry.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | docker-registry-client-async-0.2.9 |
| نام | docker-registry-client-async |
| نسخه کتابخانه | 0.2.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Richard Davis |
| ایمیل نویسنده | crashvb@gmail.com |
| آدرس صفحه اصلی | https://github.com/crashvb/docker-registry-client-async |
| آدرس اینترنتی | https://pypi.org/project/docker-registry-client-async/ |
| مجوز | Apache License 2.0 |
# docker-registry-client-async
[](https://pypi.org/project/docker-registry-client-async)
[](https://github.com/crashvb/docker-registry-client-async/actions)
[](https://coveralls.io/github/crashvb/docker-registry-client-async)
[](https://pypi.org/project/docker-registry-client-async)
[](https://github.com/PyCQA/pylint)
[](https://github.com/psf/black)
[](https://github.com/crashvb/docker-registry-client-async/blob/master/LICENSE.md)
## Overview
An AIOHTTP based Python REST client for the Docker Registry.
## Getting Started
```python
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](https://pypi.org/project/docker-registry-client-async/)
```
$ pip install docker_registry_client_async
```
### From source code
```bash
$ 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
[Source Control](https://github.com/crashvb/docker-registry-client-async)
نیازمندی
| مقدار | نام |
|---|---|
| - | aiodns |
| - | aiofiles |
| - | aiohttp |
| - | canonicaljson |
| - | www-authenticate |
| - | black |
| - | coveralls |
| - | pylint |
| - | pytest |
| - | pytest-asyncio |
| - | pytest-cov |
| >=0.3.2 | pytest-docker-registry-fixtures |
| >=0.1.2 | pytest-docker-squid-fixtures |
| - | twine |
| - | wheel |
| - | pytest-xdist |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl docker-registry-client-async-0.2.9:
pip install docker-registry-client-async-0.2.9.whl
نصب پکیج tar.gz docker-registry-client-async-0.2.9:
pip install docker-registry-client-async-0.2.9.tar.gz