Skip to content

bootFromImage

bootFromImage(ctx, caps, opts?): Promise<UnixInstance>

Defined in: packages/runtime/src/platform/boot.ts:1230

Low-level boot entry point — build a UnixInstance directly from a BootContext + PlatformCapabilities.

BootContext

BootContext from UnixImage.createBootContext.

PlatformCapabilities

PlatformCapabilities — the platform bag to use for this instance.

BootOpts

Optional per-boot BootOpts (tty, cwd, volumes, getTermSize, shutdownGrace).

Promise<UnixInstance>

A live UnixInstance.

Equivalent to runtime.boot(image) but without the Runtime wrapper. Reach for this when you already have a raw BootContext (e.g. you’re a container runtime compositing multiple images) or when you want to inject custom capabilities per-boot rather than per-runtime. For the common case prefer nodeRuntime / browserRuntime / testRuntime.

Internally: buildNamespace → an internal buildInstance that wires init, the container manager, consFS, and returns a UnixInstance ready to .boot().

import { Unix, stdSystem } from '@fishnet/core'
import { bootFromImage, createNodeCapabilities } from '@fishnet/runtime'
const image = await Unix().use(stdSystem()).build()
const sys = await bootFromImage(image.createBootContext(), createNodeCapabilities())
await sys.boot()