Skip to content

ContainerSpec

Defined in: packages/runtime/src/container/types.ts:51

Declarative description of a container — the input to ContainerRuntime.create.

A spec is the serializable shape of what to run: the namespace (rootfs + mounts + devices + permissions), the PID-1 process (bin + argv + env + cwd), and resource limits. It is fully immutable once constructed — lifecycle state lives on the Container handle returned from create(), not here.

Build a spec either by calling specFromImage (derives sensible defaults from a UnixImage) or by hand when you need fine control. Compose two specs with mergeSpecs.

readonly optional labels?: Readonly<Record<string, string>>

Defined in: packages/runtime/src/container/types.ts:55

Free-form labels for tooling (e.g. container.rm, container.restart).


readonly optional limits?: ResourceLimits

Defined in: packages/runtime/src/container/types.ts:61

Per-container resource limits (pids, fds, bytes).


readonly name: string

Defined in: packages/runtime/src/container/types.ts:53

Container name — unique within a ContainerManager.


readonly namespace: NamespaceSpec

Defined in: packages/runtime/src/container/types.ts:57

Namespace shape: rootfs, mounts, binds, devices, permissions.


readonly process: ProcessSpec

Defined in: packages/runtime/src/container/types.ts:59

PID-1 process description.