Skip to content

gdyuldin/asyncio-docker2

Repository files navigation

asyncio-docker

Asynchronous docker client for python.

image

image

Usage

import asyncio
from asyncio_docker.client import client_factory
from asyncio_docker.api import RemoteAPI


async def list_images(api):
    containers = await api.Image.list()
    return containers


async def main(loop, docker_url):
    client_class = client_factory(docker_url)
    client = client_class(docker_url, loop=loop)
    client.open()
    api = RemoteAPI(client)
    print(await list_images(api))
    client.close()


docker_url = 'unix://var/run/docker.sock'
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop, docker_url))

Testing

export VENV=./.venv
make install
make test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published