New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

docker-registry-client-async

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docker-registry-client-async

An AIOHTTP based Python REST client for the Docker Registry.

  • 1.0.0
  • Source
  • PyPI
  • Socket score

Maintainers
1

docker-registry-client-async

pypi version build status coverage status python versions linting code style license

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

VariableDefault ValueDescription
DRCA_CACERTSThe path to the certificate trust store.
DRCA_CHUNK_SIZE2097152The chunk size to use then replicating content.
DRCA_CREDENTIALS_STORE~/.docker/config.jsonThe credentials store from which to retrieve registry credentials.
DRCA_DEBUGAdds additional debug logging, mainly for troubleshooting and development.
DRCA_DEFAULT_REGISTRYindex.docker.ioThe default registry index to use when resolving image names.
DRCA_DEFAULT_NAMESPACElibraryThe default registry namespace to use when resolving image names.
DRCA_DEFAULT_TAGlatestThe default image tag to use when resolving image names.
DRCA_PROTOCOLhttpsThe default transport protocol to when communicating with a registry.

Development

Source Control

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc