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 tomanager,resolver,self, andauditLoggers. - Services, env, files, man: none.
Parameters
Section titled “Parameters”manager
Section titled “manager”The ContainerManager this Extension exposes.
resolver?
Section titled “resolver?”Optional ImageResolver; needed for
container run <name> and for /dev/container/ctl
create commands.
ContainerSelfInfo
Optional self-introspection info surfaced under
/dev/container/self/.
image?
Section titled “image?”Optional UnixImage passed to the container
bin so container unshare can fork the current image.
auditLoggers?
Section titled “auditLoggers?”Map<string, AuditLogger>
Optional audit-logger map forwarded to containerFS.
Returns
Section titled “Returns”An Extension ready to pass to Unix().use(...).
Remarks
Section titled “Remarks”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).
Example
Section titled “Example”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')