forked from bots-garden/ori
How to run Ori in a Docker sandbox
This guide shows how to package Ori as a Docker Sandboxes template and run it with sbx, so the whole stack — Claude Code included — lives in an isolated sandbox you reach from your browser. It assumes Docker and the sbx CLI on the host.
Steps
-
Get the template image — it is published on Docker Hub as
k33g/ori:0.0.2. To (re)build and push it yourself, from the repository root:./template/build.shThe script runs a multi-arch
docker buildx build --push: the SPA and the Go binaries are built in intermediate stages, then layered with theclaude-agent-acpadapter on top of the officialdocker/sandbox-templates:claude-codeimage. For a local-only image usemake templateinstead. -
Create the sandbox from your project directory, with the template and the ori kit, in detached mode:
sbx run -d claude ~/path/to/your/project \ --template k33g/ori:0.0.2 \ --kit /path/to/ori/kits/ori-d(--detached) matters: sbx stops a sandbox 30 seconds after the last CLI session on it closes, and browser traffic on a published port is not a session.sbx createholds a session only while it runs, so a sandbox created with it goesstoppedhalf a minute later. A detached sandbox is exempt from this auto-stop until yousbx stoporsbx rmit. The flag exists only onsbx run, and the mode is fixed at creation.To pin a host port, add
-p 5555:8888/tcp. Keep the/tcpsuffix: without a protocol sbx binds IPv4 only (tcp4), and a browser that resolveslocalhostto::1gets "site can't be reached" while the server is up. Avoid ports Chrome refuses outright, such as 6665–6669.The kit's startup command launches the ori server on port 8888 at every container start; the claude agent kit injects the Anthropic credentials through the sandbox proxy, so nothing needs a login inside.
-
Open the UI: the kit declares port 8888, so the command output prints the ephemeral address it published —
Published web: localhost:<port> -> 8888/tcp. Browse there, or pin a fixed port with-p 8888:8888/tcpat creation (or later withsbx ports <sandbox-name> --publish 8888:8888/tcp).
Variants
- The listen port is a kit argument (default 8888): add
--kit-arg ori.port=9000to change it, and publish that port yourself with-p 9000:9000— the port the kit declares for auto-publishing is fixed at 8888. - If the image was never pushed to Docker Hub, hand it to the sandbox runtime's own image store first:
docker save k33g/ori -o /tmp/ori.tar && sbx template load /tmp/ori.tar. - Standalone, without sbx:
docker run --rm -p 8888:8888/tcp k33g/ori(provideANTHROPIC_API_KEY, or use the demo agent below). - Credential-free demo: inside the sandbox,
pkill -x orithen relaunch with--agent-cmd ori-mock-agent. - The server log inside the sandbox is
/home/agent/.ori.log. - A stopped sandbox restarts with
sbx run -d --name <sandbox-name>(orsbx attach); the kit relaunches the server on every start. - If a sandbox stops on its own anyway, check the daemon log (
sbx daemon statusprints its path) forauto-stoplines: they mean the sandbox was not created detached.
See also
- Kit details and template contents:
kits/ori/README.md - Flags of the server the kit starts: reference: the ori command
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|