Taskbox
Podman

API

Adapter factory

ExportSignatureSummary
podman(opts?: PodmanAdapterOptions) => RuntimeAdapterReturns a RuntimeAdapter (from @taskbox/core) that drives rootless Podman.
PodmanAdapterOptions{ binary?: string; defaultImage?: string; pullPolicy?: "always" | "if-missing" | "never" }Override the binary path, image ref, and pull behaviour.

RuntimeAdapter shape

The returned adapter implements the RuntimeAdapter contract from @taskbox/core:

MethodSignatureSummary
available() => Promise<{ ok: boolean; details?: { rootless?, version?, stderr?, error? } }>Calls podman info; reports rootless flag and version.
prepareImage(ref: string) => Promise<{ digest?: string }>Honours pullPolicy. Throws TaskboxError({ code: "E_IMAGE_PULL_FAILED" }) on pull failure.
runTask({ spec, workspace, bus, signal? }) => Promise<{ exitCode, durationMs }>Spawns podman run with bind mounts, network mode, and resource flags applied; emits image.prepare.* and process.* events.

Behaviour notes

  • Container args: --rm --userns=keep-id, --network=none when spec.network.mode === "none", plus --cpus/--memory from spec.resources.
  • Mounts: workspace.inputDir → /in:ro,Z, workspace.outputDir → /out:Z.
  • Stderr parsing: each line is parsed as JSON; if it matches TaskEventSchema, it's re-emitted as a structured event, otherwise it becomes a process.stderr event verbatim.
  • Cancellation: signal.abort() triggers SIGTERM, then SIGKILL after 2 s. spec.resources.timeoutMs uses the same path and surfaces as TaskboxError({ code: "E_TIMEOUT", retryable: true }).

See the generated JSDoc reference for the full surface.

On this page