II.
Page JSON
Structured · livepage:docs-agent-mux-tutorials-docker-mode
Docker Invocation Mode json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "page:docs-agent-mux-tutorials-docker-mode",
"_kind": "Page",
"_file": "wiki/docs/agent-mux/tutorials/docker-mode.md",
"_cluster": "wiki",
"attributes": {
"nodeKind": "Page",
"sourcePath": "docs/agent-mux/tutorials/docker-mode.md",
"sourceKind": "repo-docs",
"title": "Docker Invocation Mode",
"displayName": "Docker Invocation Mode",
"slug": "docs/agent-mux/tutorials/docker-mode",
"articlePath": "wiki/docs/agent-mux/tutorials/docker-mode.md",
"article": "\n# Docker Invocation Mode\n\n`RunOptions.invocationMode = { kind: 'docker', ... }` runs the agent inside a Docker container. The adapter builds the CLI args as usual; the invocation mode wraps them with `docker run`.\n\n## Quickstart\n\n```ts\nawait client.run({\n agent: 'claude',\n prompt: 'Summarize this repo',\n invocationMode: {\n kind: 'docker',\n image: 'ghcr.io/a5c-ai/amux-runtime:latest',\n mounts: [{ host: process.cwd(), container: '/workspace' }],\n env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! },\n workdir: '/workspace',\n },\n});\n```\n\nOr via CLI:\n\n```bash\namux run claude \\\n --mode docker \\\n --image ghcr.io/a5c-ai/amux-runtime:latest \\\n --mount \"$PWD:/workspace\" \\\n --prompt \"Hello\"\n```\n\n## What the invocation mode adds\n\nThe resulting command looks like:\n\n```\ndocker run --rm -i \\\n -v <host>:<container> \\\n -e ANTHROPIC_API_KEY=... \\\n -w /workspace \\\n <image> \\\n claude --output-format jsonl --prompt \"Hello\"\n```\n\n## With `agent-mux-remote`\n\nYou can also nest `amux` itself:\n\n```ts\nawait client.run({\n agent: 'agent-mux-remote',\n prompt: 'Hello',\n invocationMode: { kind: 'docker', image: 'my/amux:latest' },\n env: { AMUX_REMOTE_AGENT: 'claude' },\n});\n```\n\nThis runs `amux run --json --agent claude --prompt ...` inside the container, and streams events back.\n\n## Tips\n\n- Use a dedicated image that pre-installs the target agent CLI.\n- Pass secrets via `-e` or Docker secrets, not baked into the image.\n- Session files stay **inside the container** unless you mount the agent's session dir to the host.\n\nSee [Invocation Modes](../reference/13-invocation-modes.md) for the full option surface.\n",
"documents": []
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "page:docs-agent-mux-tutorials",
"to": "page:docs-agent-mux-tutorials-docker-mode",
"kind": "contains_page"
}
]
}