Skip to content

UnixImage

Defined in: packages/core/src/kernel/types.ts:2025

Frozen, immutable system configuration. Multiple instances can boot from one image.

Consumed — obtain from UnixBuilder.build() and pass to a runtime’s boot().

Contains frozen filesystem layers, merged env defaults, and service declarations. Boot via a runtime (e.g. testRuntime().boot(image)) to create a live UnixInstance with a fresh writable overlay.

Images are immutable, but Fileserver references INSIDE them are NOT deep-copied — mutations to a memoryFS() you handed to the builder remain visible in every booted instance. Use frozen or per-instance fileservers for true isolation.

import { Unix, stdSystem } from '@fishnet/core'
import { testRuntime } from '@fishnet/runtime'
const image = await Unix().use(stdSystem()).build()
const a = await testRuntime().boot(image)
const b = await testRuntime().boot(image)

readonly layerStore: LayerStore

Defined in: packages/core/src/kernel/types.ts:2031

Content-addressable store of all layers in this image.


readonly topLayerId: string | undefined

Defined in: packages/core/src/kernel/types.ts:2033

ID of the topmost layer (most recent .run() step, or base). undefined only if image has no FS.

createBootContext(): BootContext

Defined in: packages/core/src/kernel/types.ts:2027

Create the boot context consumed by a runtime’s boot procedure.

BootContext


extend(): UnixBuilder

Defined in: packages/core/src/kernel/types.ts:2029

Derive a new UnixBuilder pre-loaded with this image’s frozen layers.

UnixBuilder