docker-offload-lan

module
v0.0.0-...-6c19a5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0

README

docker-offload-lan (dol)

Run your coding agents' Docker workloads, including compose stacks and kind clusters, on another machine on your LAN over SSH. Your laptop's RAM stays free, and if that machine is off or full, work falls back to local Docker automatically.

Not affiliated with Docker, Inc. docker-offload-lan is an independent community project. It is not affiliated with, endorsed by, or sponsored by Docker, Inc., and it is unrelated to Docker's official "Docker Offload" product. Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein. This project works with Docker Engine; it does not ship or modify it.

What it does

 MacBook (client)                         LAN node (Windows 11 + WSL2, or Linux)
 Claude Code ──stdio──► dol mcp ──ssh──►  dol node  (admission · leases · reaper)
                           │      ──ssh──► Docker Engine · kind clusters
                           └─► local Docker (automatic fallback)
  • Placement with admission control. An agent calls dol_acquire with a memory estimate. The node reserves the capacity or refuses with numbers, based on real memory and disk. On WSL2 that includes the Windows host's free RAM and C: drive.
  • Automatic fallback. If the node is unreachable, frozen, full or failing, the work lands on local Docker. The result says placement: "local" and why. A frozen node falls back within health_timeout_ms (measured: 2.01 s with a 2 s timeout).
  • Native CLIs. Agents keep running docker, docker compose and kubectl, using the exact prefixes dol returns (docker --context dol-tower …, kubectl --kubeconfig …).
  • Nothing leaks. Leases, heartbeats and a reaper remove everything an abandoned session left behind. Only resources carrying dol's labels, or tracked on a lease, are ever touched.
  • kind on the node. Clusters run where the RAM is. kubectl on your Mac reaches them through an SSH tunnel; kubeconfigs are written for you.
  • Ports and files. dol_forward makes node services reachable at localhost:<port>. dol_sync and dol_compose_up sync your project so relative bind mounts work unchanged.

Everything runs over SSH. Neither the Docker API nor the node API is ever exposed on TCP.

MCP tools

Tool Use it to
dol_status See node health, capacity and this session's leases
dol_acquire Reserve capacity before running anything; returns placement and command prefixes
dol_release Tear down everything of a lease, close its tunnels and delete its kubeconfigs
dol_list List leases and the resources they own
dol_stop / dol_remove Stop or remove an owned container, network, volume or compose project
dol_resize / dol_pin Change a lease's memory estimate / keep it alive after the session ends
dol_forward / dol_unforward Open or close an SSH tunnel to a node port
dol_sync Sync a directory to the node for bind mounts
dol_compose_up / dol_compose_down Run a compose project with synced, rewritten bind mounts and labels
dol_kind_create / dol_kind_load / dol_kind_delete Manage kind clusters on the lease's host

Quick start

  1. Node (Windows 11): run deploy/windows/setup.ps1 as admin, then deploy/linux/install.sh --pubkey ~/.ssh/id_ed25519.pub inside the WSL distro. For a Linux node, run only install.sh. See setup-windows.md.
  2. Mac: install dol, then run dol init (setup-mac.md). It adds the SSH host, creates the docker context, runs dol doctor and prints:
    claude mcp add -s user docker-offload-lan -- dol mcp
    
  3. Append rules/agent.md to your CLAUDE.md.
  4. When something is off, run dol doctor. Every failed check prints its fix (troubleshooting.md).

Documentation

Development

go test -race ./...                                       # unit + MCP tests
DOL_INTEGRATION=1 go test ./test/integration/...          # containerized node over real ssh
DOL_INTEGRATION=1 DOL_INTEGRATION_KIND=1 go test -run Kind ./test/integration/...

See CONTRIBUTING.md.

License

Apache-2.0. See LICENSE and NOTICE.

Directories

Path Synopsis
cmd
dol command
Command dol is the single binary of docker-offload-lan: the MCP server and CLI on the client, and the node agent on the node.
Command dol is the single binary of docker-offload-lan: the MCP server and CLI on the client, and the node agent on the node.
internal
capacity
Package capacity measures how much memory, disk and CPU a node has (brief §7.4).
Package capacity measures how much memory, disk and CPU a node has (brief §7.4).
clientsetup
Package clientsetup implements the file and docker-context changes made by `dol init` on the client.
Package clientsetup implements the file and docker-context changes made by `dol init` on the client.
compose
Package compose renders a compose project, rewrites bind mounts for a remote node and injects lease labels (brief §7.10).
Package compose renders a compose project, rewrites bind mounts for a remote node and injects lease labels (brief §7.10).
config
Package config loads and validates client and node configuration.
Package config loads and validates client and node configuration.
config/gen-schemas command
Command gen-schemas writes the config JSON Schemas into a directory.
Command gen-schemas writes the config JSON Schemas into a directory.
dockerproxy
Package dockerproxy is a Docker Engine API proxy (ADR-0040, milestone M6 spike).
Package dockerproxy is a Docker Engine API proxy (ADR-0040, milestone M6 spike).
dockerproxy/proxytest
Package proxytest measures and verifies the Docker API proxy against a real engine with the real docker CLI (ADR-0040).
Package proxytest measures and verifies the Docker API proxy against a real engine with the real docker CLI (ADR-0040).
dockerx
Package dockerx wraps the docker CLI (ADR-0009) with label-scoped operations.
Package dockerx wraps the docker CLI (ADR-0009) with label-scoped operations.
doctor
Package doctor implements `dol doctor`: end-to-end diagnostics of every link between the client and its nodes (client mode) or of the node itself (`--node`).
Package doctor implements `dol doctor`: end-to-end diagnostics of every link between the client and its nodes (client mode) or of the node itself (`--node`).
kindx
Package kindx generates kind cluster configs and runs the kind binary on the node (brief §7.9, ADR-0007).
Package kindx generates kind cluster configs and runs the kind binary on the node (brief §7.9, ADR-0007).
mcpserver
Package mcpserver implements `dol mcp`, the stdio MCP server agents use to acquire capacity (brief §8), and the Core it shares with the human CLI (`dol status`, `dol leases`, `dol release`).
Package mcpserver implements `dol mcp`, the stdio MCP server agents use to acquire capacity (brief §8), and the Core it shares with the human CLI (`dol status`, `dol leases`, `dol release`).
node
Package node is the node agent (`dol node serve`): an HTTP/1.1 JSON API on a unix socket (brief §7.2), node-side admission control (§7.3, ADR-0003), a SQLite lease store, heartbeats, the reaper (§7.6, ADR-0004) and kind operations (§7.9, ADR-0007).
Package node is the node agent (`dol node serve`): an HTTP/1.1 JSON API on a unix socket (brief §7.2), node-side admission control (§7.3, ADR-0003), a SQLite lease store, heartbeats, the reaper (§7.6, ADR-0004) and kind operations (§7.9, ADR-0007).
nodeclient
Package nodeclient is the Go client of the node API (pkg/api/v1).
Package nodeclient is the Go client of the node API (pkg/api/v1).
nodefake
Package nodefake is a small in-memory implementation of the node API (pkg/api/v1) for client tests.
Package nodefake is a small in-memory implementation of the node API (pkg/api/v1) for client tests.
placement
Package placement decides where a workload runs (brief §7.5): try nodes by priority with short health checks and a bounded lease request, then apply the fallback policy.
Package placement decides where a workload runs (brief §7.5): try nodes by priority with short health checks and a bounded lease request, then apply the fallback policy.
sshx
Package sshx spawns the system ssh binary (ADR-0002): one-shot remote commands and stdio "connections" used to reach the node API through `dol node dial-stdio`.
Package sshx spawns the system ssh binary (ADR-0002): one-shot remote commands and stdio "connections" used to reach the node API through `dol node dial-stdio`.
state
Package state manages the client state directory (ADR-0010):
Package state manages the client state directory (ADR-0010):
sync
Package sync mirrors a local project directory to the node with rsync over ssh (brief §7.10).
Package sync mirrors a local project directory to the node with rsync over ssh (brief §7.10).
testutil/fakessh
Package fakessh provides a stand-in for the ssh binary in tests: the test binary re-executes itself as "ssh".
Package fakessh provides a stand-in for the ssh binary in tests: the test binary re-executes itself as "ssh".
tunnel
Package tunnel manages `ssh -L` port forwards as child processes (brief §7.8).
Package tunnel manages `ssh -L` port forwards as child processes (brief §7.8).
version
Package version exposes build metadata, set via -ldflags by GoReleaser.
Package version exposes build metadata, set via -ldflags by GoReleaser.
pkg
api/v1
Package v1 holds the public wire contract of docker-offload-lan.
Package v1 holds the public wire contract of docker-offload-lan.
test
integration/harness
Package harness runs a containerized "fake node" for integration tests: Ubuntu 24.04 provisioned by the real deploy/linux/install.sh (--container-mode), with Docker-in-Docker, sshd on 2222 and the dol agent (ADR-0035).
Package harness runs a containerized "fake node" for integration tests: Ubuntu 24.04 provisioned by the real deploy/linux/install.sh (--container-mode), with Docker-in-Docker, sshd on 2222 and the dol agent (ADR-0035).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL