How to use the aiodocker.containers.DockerContainer function in aiodocker

To help you get started, we’ve selected a few aiodocker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aiodocker / aiodocker / containers.py View on Github external
async def get(self, container, **kwargs):
        data = await self.docker._query_json(
            "containers/{container}/json".format(container=container),
            method="GET",
            params=kwargs,
        )
        return DockerContainer(self.docker, **data)
github aio-libs / aiodocker / aiodocker / containers.py View on Github external
def container(self, container_id, **kwargs):
        data = {"id": container_id}
        data.update(kwargs)
        return DockerContainer(self.docker, **data)
github aio-libs / aiodocker / aiodocker / containers.py View on Github external
async def create(self, config, *, name=None):
        url = "containers/create"

        config = json.dumps(config, sort_keys=True).encode("utf-8")
        kwargs = {}
        if name:
            kwargs["name"] = name
        data = await self.docker._query_json(
            url, method="POST", data=config, params=kwargs
        )
        return DockerContainer(self.docker, id=data["Id"])