# Podman

> RuntimeAdapter that runs Taskbox tasks in rootless Podman.

Source: https://taskbox.n.yatsyk.com/docs/podman

# @taskbox/podman

A `RuntimeAdapter` for [`@taskbox/core`](/docs/core) that runs each task in a
rootless Podman container with `--rm --userns=keep-id` and bind-mounts only
the task's `in/` (read-only) and `out/` (read-write) directories. Stdout is
emitted as `process.stdout` events; stderr lines are auto-detected as either
JSON `TaskEvent`s or raw `process.stderr` lines.

* **Stability:** beta
* **Platforms:** node (Linux/macOS with Podman installed)

## Install

```bash
npm i @taskbox/podman @taskbox/core
```

## Use as a runtime

```ts
import { runTask } from "@taskbox/core";
import { podman } from "@taskbox/podman";

const adapter = podman({ pullPolicy: "if-missing" });

const result = await runTask(
  {
    tool: "media.downloadSubtitles",
    input: { url: "https://youtu.be/jNQXAC9IVRw", languages: ["en"] },
    network: { mode: "direct" },
  },
  adapter,
);
```

## Tune the binary or pull policy

```ts
const adapter = podman({
  binary: "/usr/bin/podman",
  defaultImage: "taskbox/kitchen-sink:dev",
  pullPolicy: "always", // or "if-missing" | "never"
});
```

See [API](./api.mdx) for the full export list.
