Sign Up

DockerService

class DockerService()

Read-only Docker Engine status. Nothing here starts or restarts Docker.

A sandbox whose daemon predates this feature answers status and wait_until_ready with a NotFoundError (404).

DockerService.__init__

def __init__(transport: AsyncTransport) -> None

DockerService.status

async def status() -> DockerStatus

Return the current Docker Engine status for this boot, answered immediately.

Raises NotFoundError (404) against an older daemon without the route.

DockerService.wait_until_ready

async def wait_until_ready(*,
                           timeout: float = DOCKER_WAIT_DEFAULT_TIMEOUT_SECONDS) -> DockerStatus

Poll the Docker status until it is ready and return that status.

timeout is the wait budget in seconds (default 60); 0 waits without a deadline — avoid it for sandboxes whose Docker can stay deferred. Each poll asks the daemon to hold for up to one second while Docker is starting; answers that come back sooner are spaced 0.5 s apart.

Raises DockerNotReadyError as soon as Docker settles in a state that cannot become ready (failed, not_present, disabled, unmanaged, unsupported, or deferred with reason function-ready-template), and DockerWaitTimeoutError when the budget runs out while Docker is still starting or deferred (gate-closed) — including when a status request is still unanswered at the deadline. No request runs more than a fraction of a second past the deadline.

DockerStatus

@dataclass(frozen=True)
class DockerStatus()

Attributes:

  • owner DockerOwner
  • state DockerState
  • process_id Optional[str] = None
  • reason Optional[str] = None
  • raw_owner Optional[str] = None
  • raw_state Optional[str] = None

SyncDockerService

class SyncDockerService()

Read-only Docker Engine status. Nothing here starts or restarts Docker.

SyncDockerService.__init__

def __init__(impl: DockerService, bridge: SyncBridge) -> None

SyncDockerService.status

def status() -> DockerStatus

Return the current Docker Engine status for this boot, answered immediately.

SyncDockerService.wait_until_ready

def wait_until_ready(*,
                     timeout: float = DOCKER_WAIT_DEFAULT_TIMEOUT_SECONDS) -> DockerStatus

Poll the Docker status until it is ready and return that status.

DockerState

DockerState = Literal['ready', 'starting', 'failed', 'not_present', 'disabled', 'unmanaged', 'deferred', 'unsupported', 'unknown']

DockerOwner

DockerOwner = Literal['daemon', 'entrypoint', 'none', 'unknown']