Launch coding agents in isolated Docker containers.
Project description
Launch coding agents (or a plain shell) in isolated Docker containers, with the current working directory mounted as the workspace.
Overview
paddock assembles and executes a docker run command from a layered configuration system. Config is resolved in priority order:
User-level TOML (~/.config/paddock/config.toml)
Project-level TOML (<workdir>/.paddock/config.toml)
Extra TOML file via PADDOCK_CONFIG_FILE env var
Extra TOML file via --config-file CLI flag
PADDOCK_* environment variables
CLI flags
Later sources overwrite earlier ones; volumes entries are additive.
Requirements
Python 3.12+
Docker (CLI must be available on PATH)
Installation
pip install phx-paddock
Or with uv:
uv tool install phx-paddock
Quick Start
Drop into a plain bash shell inside the current directory:
paddock --image=ubuntu:24.04 --agent=false
Run Claude Code in an isolated container:
paddock --image=my-claude-image --agent=claude
Print the assembled docker run command without executing it:
paddock --image=ubuntu:24.04 --agent=false --dry-run
Configuration
TOML files
Place a config.toml at ~/.config/paddock/ (user-level) or <project>/.paddock/ (project-level). Both files are optional.
agent = "claude"
image = "my-claude-image:latest"
network = "my-docker-network"
[volumes]
"/host/path" = "/container/path:ro"
[build]
dockerfile = "images/Dockerfile"
context = "."
policy = "daily"
[build.args]
AGENT = "claude"
PYTHON_VERSION = "3.13"
Config fields
Field |
Type |
Description |
|---|---|---|
agent |
string or false |
Agent key ("claude") or false for shell |
image |
string |
Docker image to run (required) |
network |
string (optional) |
Docker network to attach the container to |
volumes |
{host: container} map |
Extra bind-mounts; container path may end in :ro or :rw (bare path defaults to :ro) |
build |
sub-table (optional) |
Image auto-build settings (see below) |
Build sub-table
Field |
Type |
Description |
|---|---|---|
dockerfile |
string |
Path to the Dockerfile (required if build table is present) |
context |
string (optional) |
Docker build context path |
policy |
"always" / "daily" / "if-missing" / "weekly" |
When to rebuild the image |
args |
{name: value} map (optional) |
Build-time --build-arg values |
Environment variables
Any config field can be set via an environment variable by uppercasing its name and prefixing with PADDOCK_. Nested keys are joined with _:
PADDOCK_IMAGE=my-claude-image
PADDOCK_AGENT=claude
PADDOCK_BUILD_DOCKERFILE=images/Dockerfile
PADDOCK_BUILD_POLICY=daily
PADDOCK_CONFIG_FILE=/path/to/extra.toml # loads an additional TOML file
CLI flags
paddock [FLAGS] [--] [COMMAND...]
--agent AGENT Agent key (e.g. "claude") or "false" for a shell
--build-args-KEY=VALUE Build-time ARG (repeatable)
--build-context PATH Docker build context
--build-dockerfile PATH Path to Dockerfile
--build-policy POLICY Build policy (always|daily|if-missing|weekly)
--config-file PATH Load an additional TOML config file
--dry-run Print the docker command and exit without running it
--image IMAGE Docker image
--network NETWORK Docker network
--quiet Suppress all logging and the docker command printout
--volume HOST:CONTAINER[:MODE] Extra bind-mount (repeatable)
--workdir PATH Host path to use as the workspace (default: CWD)
Everything after the first positional argument (or after --) is passed as the container command:
paddock claude --allow-dangerously-skip-permissions --continue
paddock --image=my-claude-image -- --allow-dangerously-skip-permissions --continue
Agents
claude
Runs claude inside the container. Mounts ~/.claude from the host to /root/.claude:rw so authentication and configuration persist between sessions.
false (shell)
Runs /bin/bash. Useful for exploring the container environment or running ad-hoc commands without a coding agent.
Adding agents
Additional agents can be registered via the paddock.agents entry-point group in any installed package:
[project.entry-points."paddock.agents"]
my-agent = "mypackage.agents:MyAgent"
Each agent must subclass paddock.agents.BaseAgent and implement get_command() and get_volumes().
Docker Image
A ready-to-use Dockerfile is included in images/. It installs Python (via the deadsnakes PPA), Node.js, and the selected coding agent.
Build arguments:
ARG |
Default |
Description |
|---|---|---|
UBUNTU_VERSION |
24.04 |
Ubuntu base image tag |
AGENT |
none |
claude or none |
NODE_VERSION |
22 |
Node.js major version |
PYTHON_VERSION |
3.13 |
Python version (installed from deadsnakes) |
Build the image manually:
docker build \
--build-arg AGENT=claude \
-t my-claude-image \
-f images/Dockerfile .
Or set a [build] table in your config and let paddock build it automatically according to your chosen policy.
Licence
MIT — see LICENCE.txt.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phx_paddock-0.2.0.tar.gz.
File metadata
- Download URL: phx_paddock-0.2.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adc68e6f2b0d0af5e532d0b175f6c55696998546ec652c3052c016f6a9b7d071
|
|
| MD5 |
357e8604adc07541cd21c7818552b81e
|
|
| BLAKE2b-256 |
cd1603220ea71f7765114e05d4aaf391486ddce319253b4400ee108c5eddab46
|
File details
Details for the file phx_paddock-0.2.0-py3-none-any.whl.
File metadata
- Download URL: phx_paddock-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eef6e5728c82055d5cb3530135dee235caca32b90c026449ec6ac50e78345ef7
|
|
| MD5 |
11e594478e2a96f6ee95558b1bcc422e
|
|
| BLAKE2b-256 |
0811be90f2e8036fa3507fd2a66b4f2197e2d2477fa79d29800cb431860a166b
|