Skip to main content

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.

PyPI version Python versions MIT Licence

Overview

paddock assembles and executes a docker run command from a layered configuration system. Config is resolved in priority order:

  1. User-level TOML (~/.config/paddock/config.toml)

  2. Project-level TOML (<workdir>/.paddock/config.toml)

  3. Extra TOML file via PADDOCK_CONFIG_FILE env var

  4. Extra TOML file via --config-file CLI flag

  5. PADDOCK_* environment variables

  6. 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

phx_paddock-0.3.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phx_paddock-0.3.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file phx_paddock-0.3.1.tar.gz.

File metadata

  • Download URL: phx_paddock-0.3.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for phx_paddock-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4155db90f811e7fa429b65809028b36805731d9006ac250f8bf0d9a8a0658835
MD5 f0dd3cfd138a376c63a9b791e5adea30
BLAKE2b-256 1f40990c4ec8fc82c2d540138d94cc58db83be44755f6674bae04072ef95cf60

See more details on using hashes here.

File details

Details for the file phx_paddock-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: phx_paddock-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for phx_paddock-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b054c439404edefa9c07fe0f296f5f0c784a532dbe3039584e5e599be1cb7488
MD5 99c4ef57ae994155bb5cce1e8b024dc1
BLAKE2b-256 c928d1e180e3bc3fec4f022046bd984a8c6de2abfb80ed69d2c08502f349bf9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page