docker
wrknv.container.runtime.docker
¶
Docker Runtime Implementation¶
Docker-specific implementation of the container runtime.
Classes¶
DockerRuntime
¶
Bases: ContainerRuntime
Docker implementation of container runtime.
Functions¶
build_image
¶
build_image(
dockerfile: str,
tag: str,
context: str,
build_args: dict[str, str] | None,
**extra_options: Any
) -> CompletedProcess
Build a Docker image.
Source code in wrknv/container/runtime/docker.py
container_exists
¶
Check if Docker container exists.
Source code in wrknv/container/runtime/docker.py
container_running
¶
Check if Docker container is running.
Source code in wrknv/container/runtime/docker.py
exec_in_container
¶
exec_in_container(
name: str,
command: list[str],
interactive: bool,
tty: bool,
user: str | None,
workdir: str | None,
environment: dict[str, str] | None,
) -> CompletedProcess
Execute command in a running Docker container.
Source code in wrknv/container/runtime/docker.py
get_container_logs
¶
get_container_logs(
name: str,
follow: bool,
tail: int | None,
since: str | None,
) -> CompletedProcess
Get Docker container logs.
Source code in wrknv/container/runtime/docker.py
inspect_container
¶
Get detailed Docker container information.
Source code in wrknv/container/runtime/docker.py
is_available
¶
Check if Docker is available.
Uses circuit breaker to prevent repeated checks when Docker is unavailable. If circuit is open, raises RuntimeError which callers should catch.
Source code in wrknv/container/runtime/docker.py
list_containers
¶
List Docker containers.
Source code in wrknv/container/runtime/docker.py
remove_container
¶
Remove a Docker container.
Source code in wrknv/container/runtime/docker.py
run_container
¶
run_container(
image: str,
name: str,
detach: bool,
volumes: list[str] | None,
environment: dict[str, str] | None,
ports: list[str] | None,
workdir: str | None,
command: list[str] | None,
**extra_options: Any
) -> CompletedProcess
Start a new Docker container.
Source code in wrknv/container/runtime/docker.py
start_container
¶
Start an existing Docker container.
Source code in wrknv/container/runtime/docker.py
stop_container
¶
Stop a running Docker container.