A minimal Docker wrapper for @mariozechner/pi-coding-agent so you can run pi against any local project without installing Node or the agent on your host. The docker image also includes python (and uv) for pi-agent to use.
- Dockerfile —
node:22-trixie-slimbase, installspiglobally, pre-creates a world-writable/home/node/.piso the container works under any UID. - run.sh — runs the container against the current directory, mapped to
/workspace, with~/.pimounted for persistent sessions/config.
- Docker
- A directory at
~/.pion the host (created automatically on first use; you canmkdir -p ~/.pito be safe).
docker build -t pi-docker .From the project directory you want pi to operate on use the below (or save it as an executable):
docker run --rm -it \
--name pi-docker \
-u $(id -u):$(id -g) \
-w /workspace \
-v "$PWD:/workspace" \
-v "$HOME/.pi:/home/node/.pi" \
pi-docker "$@" # or ghcr.io/samyoshua/pi-docker--rm -it— interactive, removed on exit.-u $(id -u):$(id -g)— runs as your host user so files created in/workspacearen't owned by root.-v "$PWD:/workspace"— mounts your current directory as the agent's workspace.-v "$HOME/.pi:/home/node/.pi"— persistspisessions/config across runs on the host.
- The Dockerfile intentionally does not use
USER node. Combined with--user $(id -u):$(id -g)at runtime, the container UID has no/etc/passwdentry, soHOMEmust point to a directory writable by any UID — hence thechmod -R 777 /home/node. - If you change
HOMEin the Dockerfile, update the~/.pimount target in run.sh to match.
EACCES: permission denied, mkdir '/home/node/.pi/...'
The host ~/.pi directory is owned by a different user than $(id -u). Fix with:
sudo chown -R "$(id -u):$(id -g)" ~/.piOr remove the -v "$HOME/.pi:/home/node/.pi" line in run.sh to use ephemeral in-container state.