Skip to content

containerManagement

containerManagement(manager, resolver?, self?, image?, auditLoggers?): Extension

Defined in: packages/runtime/src/container/container-fs.ts:1672

Mount the container filesystem and register the container dispatcher bin.

What this registers:

  • Bins: container — single dispatcher that routes all subcommands (run, stop, rm, ps, kill, wait, exec, attach, logs, inspect, nsenter, unshare, drain, restart, help).
  • Mounts: /dev/container — a containerFS instance bound to manager, resolver, self, and auditLoggers.
  • Services, env, files, man: none.

ContainerManager

The ContainerManager this Extension exposes.

ImageResolver

Optional ImageResolver; needed for container run <name> and for /dev/container/ctl create commands.

ContainerSelfInfo

Optional self-introspection info surfaced under /dev/container/self/.

UnixImage

Optional UnixImage passed to the container bin so container unshare can fork the current image.

Map<string, AuditLogger>

Optional audit-logger map forwarded to containerFS.

Extension

An Extension ready to pass to Unix().use(...).

When resolver is omitted, a no-op resolver is substituted for the container bin so container run fails with a clear error rather than crashing; the filesystem, however, is constructed with resolver as-is (so writes to /dev/container/ctl without a resolver throw EINVAL).

import { Unix } from '@fishnet/core'
import { containerManagement } from '@fishnet/runtime/container/container-fs'
const sys = await Unix().use(containerManagement(manager, resolver)).build().boot()
await sys.run('container ps --all')