RootContainer
Defined in: packages/runtime/src/container/types.ts:595
Top-level container that owns a live UnixInstance and a ContainerRegistry of child containers.
Consumed — built by the RuntimeAware builder chain.
A RootContainer extends Container with nested-container spawn APIs
(run(), create()) and direct access to the underlying image / instance.
Extends
Section titled “Extends”Properties
Section titled “Properties”containers
Section titled “containers”
readonlycontainers:ContainerRegistry
Defined in: packages/runtime/src/container/types.ts:601
Child container registry.
createdAt
Section titled “createdAt”
readonlycreatedAt:number
Defined in: packages/runtime/src/container/types.ts:383
Epoch ms when the handle was constructed (independent of start()).
Inherited from
Section titled “Inherited from”exitCode
Section titled “exitCode”
readonlyexitCode:ExitCode|undefined
Defined in: packages/runtime/src/container/types.ts:379
PID-1 exit code. undefined until PID 1 exits.
Inherited from
Section titled “Inherited from”
readonlyimage:UnixImage
Defined in: packages/runtime/src/container/types.ts:603
The image this root was booted from.
instance
Section titled “instance”
readonlyinstance:UnixInstance
Defined in: packages/runtime/src/container/types.ts:605
The live UnixInstance backing this root container.
readonlyname:string
Defined in: packages/runtime/src/container/types.ts:375
Container name — unique within the manager registry.
Inherited from
Section titled “Inherited from”
readonlyspec:ContainerSpec
Defined in: packages/runtime/src/container/types.ts:381
The spec this container was created from. Frozen.
Inherited from
Section titled “Inherited from”
readonlystate:ContainerState
Defined in: packages/runtime/src/container/types.ts:377
Current lifecycle state. Snapshot — may change concurrently with async ops.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[asyncDispose]()
Section titled “[asyncDispose]()”[asyncDispose]():
Promise<void>
Defined in: packages/runtime/src/container/types.ts:443
await using cleanup: stop if running, remove if not already removed.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”commit()
Section titled “commit()”commit():
Promise<Layer>
Defined in: packages/runtime/src/container/types.ts:441
Freeze the writable upper layer into a new image layer (Docker commit).
Returns
Section titled “Returns”Promise<Layer>
Inherited from
Section titled “Inherited from”create()
Section titled “create()”create(
image,opts?):Promise<Container>
Defined in: packages/runtime/src/container/types.ts:599
Create a child container (in created state) in this root’s registry.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<Container>
drain()
Section titled “drain()”drain(
timeout?):Promise<void>
Defined in: packages/runtime/src/container/types.ts:412
Send SIGUSR1 to PID 1 for in-process draining, then fall back to kill on timeout.
Parameters
Section titled “Parameters”timeout?
Section titled “timeout?”number
Returns
Section titled “Returns”Promise<void>
Invariant
Section titled “Invariant”Transitions running → draining → stopped. Timeout defaults to 5000 ms.
Inherited from
Section titled “Inherited from”exec()
Section titled “exec()”exec(
bin,argv?,opts?):Promise<ExitCode>
Defined in: packages/runtime/src/container/types.ts:430
Spawn a one-shot process inside the running container.
Parameters
Section titled “Parameters”string
string[]
Returns
Section titled “Returns”Promise<ExitCode>
Invariant
Section titled “Invariant”Valid only from running. Env layers over the container’s
merged env; output is teed into the container log buffer.
Invariant
Section titled “Invariant”tty: true toggles raw mode on /dev/cons around the call and
restores cooked mode in a finally — safe against mid-exec exit.
Inherited from
Section titled “Inherited from”kill()
Section titled “kill()”kill():
Promise<void>
Defined in: packages/runtime/src/container/types.ts:406
Immediate SIGKILL to PID 1 and all descendants. No grace period.
Returns
Section titled “Returns”Promise<void>
Invariant
Section titled “Invariant”Valid from running or draining.
Inherited from
Section titled “Inherited from”logs()
Section titled “logs()”logs():
string
Defined in: packages/runtime/src/container/types.ts:439
Snapshot of the container’s merged stdout/stderr log buffer.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”remove()
Section titled “remove()”remove():
void
Defined in: packages/runtime/src/container/types.ts:421
Dispose namespace resources and log buffer; transitions to removed.
Returns
Section titled “Returns”void
Invariant
Section titled “Invariant”Not valid while running or draining — stop first.
Invariant
Section titled “Invariant”Idempotent on removed.
Inherited from
Section titled “Inherited from”restart()
Section titled “restart()”restart():
Promise<void>
Defined in: packages/runtime/src/container/types.ts:414
Stop (if running) then start again. Used by restart policies.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”run(
image,opts?):Promise<ExitCode>
Defined in: packages/runtime/src/container/types.ts:597
Shorthand: create + start + wait + remove a child.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ExitCode>
start()
Section titled “start()”start():
Promise<void>
Defined in: packages/runtime/src/container/types.ts:393
Build the namespace, construct a kernel, spawn PID 1.
Returns
Section titled “Returns”Promise<void>
Invariant
Section titled “Invariant”Valid from created, stopped, or failed. Throws from any
other state.
Invariant
Section titled “Invariant”On restart (from stopped/failed), the prior namespace is disposed and a fresh one is built — log buffer persists.
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop(
timeout?):Promise<void>
Defined in: packages/runtime/src/container/types.ts:400
Graceful shutdown: SIGTERM → wait timeout ms → SIGKILL on holdouts.
Parameters
Section titled “Parameters”timeout?
Section titled “timeout?”number
Returns
Section titled “Returns”Promise<void>
Invariant
Section titled “Invariant”Idempotent on stopped / failed (returns immediately).
Invariant
Section titled “Invariant”Valid from running or draining.
Inherited from
Section titled “Inherited from”wait()
Section titled “wait()”wait():
Promise<ExitCode>
Defined in: packages/runtime/src/container/types.ts:437
Resolve with PID-1’s exit code.
Returns
Section titled “Returns”Promise<ExitCode>
Invariant
Section titled “Invariant”If PID 1 already exited, resolves with the cached code. If never started, throws. Otherwise waits for PID 1 to exit.