Skip to content

UnixImageImpl

Defined in: packages/core/src/image.ts:102

Concrete implementation of UnixImage.

Produced by UnixBuilderImpl.build and consumed by a BootRuntime — callers normally obtain one via await Unix().use(...).build() and hand it to nodeRuntime().boot(image), testRuntime().boot(image), etc. Do not instantiate directly.

Holds the merged MergedConfig, the frozen stack of filesystem layers (baseFs plus every .run() step), a content-addressable LayerStore, and the build cache that memoizes .run() steps across subsequent builds. The image itself is immutable; multiple instances can boot from it without interfering.

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

new UnixImageImpl(init): UnixImageImpl

Defined in: packages/core/src/image.ts:109

ImageInit

UnixImageImpl

readonly buildCache: BuildCache

Defined in: packages/core/src/image.ts:107


readonly layerStore: LayerStore

Defined in: packages/core/src/image.ts:105

Content-addressable store of all layers in this image.

UnixImage.layerStore


readonly topLayerId: string | undefined

Defined in: packages/core/src/image.ts:106

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

UnixImage.topLayerId

createBootContext(): BootContext

Defined in: packages/core/src/image.ts:118

See UnixImage.createBootContext. Returns a shallow-cloned, read-only boot context.

BootContext

UnixImage.createBootContext


extend(): UnixBuilder

Defined in: packages/core/src/image.ts:131

See UnixImage.extend. Returns a new builder seeded with this image’s frozen state.

UnixBuilder

UnixImage.extend