hyperdock_container.runtime.docker.runtime_docker#

Classes#

DockerContainerRuntime

Helper class that provides a standard way to create an ABC using

Module Contents#

class hyperdock_container.runtime.docker.runtime_docker.DockerContainerRuntime(settings: hyperdock_container.settings.DockerSettings)#

Bases: hyperdock_container.runtime.runtime.ContainerRuntime

Helper class that provides a standard way to create an ABC using inheritance.

settings: hyperdock_container.settings.DockerSettings#
property client#
create(image_tag: str, workdir: str, command: str, envs: dict, **kwargs) str#

Create an image from tag :param image_tag: :param workdir: :param command: :param envs: :return: container id

start(container_id: str) None#

Start a container :param container_id: :return:

stop(container_id: str) None#

Stop a container :param container_id: :return:

remove(container_id: str) None#

Remove a container :param container_id: :return:

commit(container_id: str, repository: str, tag: str) str#

Commit a container to an image :param container_id: :param repository: :param tag: :return: image id

pull(image_tag: str) str#

Pull an image from tag and returns its id :param image: :return:

list_image() list[tuple[str, list[str]]]#

List all images :return: list of image id and tag list

put_archive(container_id: str, source: pathlib.Path, dest: str) None#

Put an archive to a container :param container_id: :param source: :param dest: :return:

run(container_id: str, stdin_str: str | None = None, **kwargs) str#

Run a command in a container :param container_id: :param stdin_str: :return: stdout_str of container