Skip to content
View as Markdown

Docker Engine status inside the sandbox (sandbox.docker). Read-only: nothing here starts or restarts Docker. The sandbox env variable DAYTONA_DOCKER_START chooses how Docker starts: auto (default; start the image’s dockerd when it ships one), entrypoint (the image’s own entrypoint starts Docker; only wait for it) or off (neither start nor wait; state disabled). Unknown values count as auto.

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

new DockerService(transport: HttpTransport): DockerService;

Parameters:

  • transport HttpTransport

Returns:

  • DockerService
status(): Promise<DockerStatus>;

Current Docker Engine status for this boot, answered immediately. Throws NotFoundError (404) against an older daemon without the route.

Returns:

  • Promise<DockerStatus>
waitUntilReady(options: DockerWaitOptions = {}): Promise<DockerStatus>;

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

Each poll asks the daemon to hold for up to one second while Docker is starting; answers that come back sooner are spaced 500 ms apart. Throws 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. timeout: 0 waits without a deadline.

Parameters:

  • options DockerWaitOptions = {}

Returns:

  • Promise<DockerStatus>

type DockerOwner = 'none' | 'daemon' | 'entrypoint' | 'unknown'

type DockerState = 'not_present' | 'disabled' | 'unmanaged' | 'deferred' | 'starting' | 'ready' | 'failed' | 'unsupported' | 'unknown'

Properties:

  • owner DockerOwner
  • rawOwner string
  • processId? string | null
  • reason? string | null
  • state DockerState
  • rawState string

Properties:

  • timeout? number - Wait budget in milliseconds. Default 60 000. 0 waits without a deadline — avoid it for sandboxes whose Docker can stay deferred.