Run a container
run_containerCreate and start a Docker container from an image, pulling it if missing. It runs in the background by default and blocks risky options unless you confirm them.
Instructions
Create and start a container from an image (pulled if missing), in the background unless detach is false. Dangerous options (privileged, the host's network, processes or IPC, extra capabilities, devices, mounting the Docker socket, the host's root or the person's home) are refused unless confirmedDangerous is true: ask the person first, naming what they give the container. Changes the machine: confirm with the person first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment variables | |
| ipc | No | ||
| pid | No | ||
| name | No | ||
| image | Yes | The image, e.g. nginx:1.27 or postgres:17 | |
| ports | No | Published ports, "host:container", e.g. "8080:80"; "127.0.0.1:8080:80" to keep them on this computer | |
| capAdd | No | ||
| detach | No | In the background (default); false waits for it to finish and returns its output | |
| remove | No | Remove it when it stops | |
| command | No | The command and its arguments, one per item; the image's when missing | |
| devices | No | ||
| network | No | A network to join | |
| restart | No | ||
| volumes | No | Mounts, "named-volume:/path" or "/host/path:/path[:ro]" | |
| workdir | No | ||
| privileged | No | ||
| confirmedDangerous | No | The person confirmed the dangerous options, knowing what they give the container |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| exitCode | Yes | ||
| container | Yes | Its id (detached) | |
| truncated | Yes | The start was left out: it was longer than a model's context fits |