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=ubuntu:24.04
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 --image=ubuntu:24.04 --agent=false -- bash -c "echo hello"

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.1.1.tar.gz (13.2 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.1.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phx_paddock-0.1.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for phx_paddock-0.1.1.tar.gz
Algorithm Hash digest
SHA256 394f4dee15df97c73221d20c11ec3e4b36386725cd57fb2c4ee26c561ee42730
MD5 415bada5fb6f0a1f0d494d4131d66599
BLAKE2b-256 b5dd41dc26e3962286fe00376fc75d43834c06522c72c84d465cd8bb9986c58b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phx_paddock-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for phx_paddock-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76f6f09e4608869fe4eb5631940a4b9c2beb735010c6cc521913ce529a675a46
MD5 c9b01b7d62f159d0a7b57e2aae224ff6
BLAKE2b-256 58d105f524a32a61892ad38c10870a92994a87b08789b852e599e65718c749f3

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