Skip to content
View as Markdown
class DockerService()

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

def __init__(impl: AsyncDockerService, bridge: SyncBridge) -> None
def status() -> DockerStatus

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

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

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

class AsyncDockerService()

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).

def __init__(transport: AsyncTransport) -> None
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.

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.

@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
DockerState = Literal['ready', 'starting', 'failed', 'not_present', 'disabled', 'unmanaged', 'deferred', 'unsupported', 'unknown']
DockerOwner = Literal['daemon', 'entrypoint', 'none', 'unknown']