Audit found README/AGENTS carried a stale compose/volume set that diverged from the shipped docker-compose.yml (DOCKER_HUB + compose + .env.example were already consistent — README was the outlier): - README compose block + 'Volumes and persistence' table: correct volume names (devbox-shell-history not -bash-history; devbox-uv at ~/.local/share/uv not devbox-uv-tools at /opt/uv-tools — the latter would SHADOW the baked mempalace install at UV_TOOL_DIR); add devbox-ssh-local + devbox-zoxide; mark devbox-palace/-chroma-cache optional; WORKSPACE_PATH/SSH_KEY_PATH (not HOST_WORKSPACE). - README quickstart: 'compose exec -u developer' (no USER in image; bare exec lands a root shell). - README: pi-studio now 'shipped' not 'planned'; build-pipeline + tag table cover -studio + smoke-studio/build-variant-studio. - AGENTS: backward-compat volume names corrected; repo-layout bullets cover pi-studio install + studio-expose + STUDIO_EXPOSE bridge. - DOCKER_HUB: MemPalace source link -> upstream MemPalace/mempalace (matches Dockerfile.base + CHANGELOG refs). Note: the shipped v1.0.0 CHANGELOG migration note still lists the old (incorrect) volume names; left as immutable released history.
7.0 KiB
AGENTS.md — pi-devbox
Self-contained Docker image for the pi coding-agent. Decoupled from
opencode-devbox at v1.0.0 (2026-06-09); previously pi-devbox was a thin
re-brand of opencode-devbox's pi-only variant.
Repository layout
Dockerfile.base— multi-arch base layer with system packages, GitHub-binary tools (fzf, eza, zoxide, neovim, bat, gosu, gitleaks, git-lfs, uv, gitea-mcp, tealdeer), AWS CLI v2, mempalace + toolkit, Node.js, Python toolchain, locales, ssh ControlMaster defaults, and/etc/tmux.confwith 0-indexed sessions.Dockerfile.variant—FROM base-<hash>, adds pi + companions (pi-toolkit,pi-extensions,pi-fork,pi-observational-memory) and, whenINSTALL_STUDIO=true, vendorspi-studioto/opt/pi-studio(-studiovariant).entrypoint.sh— UID/GID alignment as root, then drops todeveloper.entrypoint-user.sh— per-container start: SSH ControlMaster socket dir, LAN-access setup, MemPalace init, pi-toolkit + pi-extensions deploy, mempalace-bridge symlink, fork/recall + pi-studio pi-install, optionalstudio-exposebridge (whenSTUDIO_EXPOSE=1), skillset deploy.rootfs/— files baked into the image (bash aliases, inputrc, setup-lan-access.sh,studio-exposehelper).scripts/smoke-test.sh— sanity checks run by CI before pushing to Hub..gitea/workflows/docker-publish.yml— two-phase CI (base-decide → build-base → smoke → build-variant → promote-base-latest → update-description). The-studiovariant adds independentsmoke-studio+build-variant-studiojobs that gate only the-studiotags (never the core:latestrelease).
Versioning scheme
- Tags follow semver. v1.0.0 is the first decoupled release; future
minor bumps add variants (
-studio,-studio-tex); patch bumps follow pi npm version updates and small fixes. - Docker Hub tags:
joakimp/pi-devbox:vX.Y.Z+joakimp/pi-devbox:latest- (since v1.1.0)
joakimp/pi-devbox:vX.Y.Z-studio+joakimp/pi-devbox:latest-studio. Internal tags:joakimp/pi-devbox:base-<hash>(content-addressed) +joakimp/pi-devbox:base-latest(alias of most recent base).
- (since v1.1.0)
Release-day checklist
- Confirm
pi --versionresolves from npm to the expected version (curl -sf 'https://registry.npmjs.org/@earendil-works%2Fpi-coding-agent/latest' | jq -r .version). - Update
CHANGELOG.mdUnreleased → vX.Y.Z section. - Verify
docker compose upworks locally with the currentlatestimage if you're upgrading users from a previous version. - Push tag:
git tag vX.Y.Z && git push origin vX.Y.Z. - Watch CI: smoke job builds amd64 only and asserts size + extensions + pi version + new-base-tooling presence. Variant build is multi-arch (amd64 + arm64) only after smoke passes.
- Verify the Hub tags appear (latest + vX.Y.Z, the
-studiopair, plus base-latest if the base was rebuilt this run). - Revoke any short-lived Gitea PAT used during the release at
gitea.jordbo.se/user/settings/applications.
Cache-hit footgun (must-know)
PI_VERSION defaults to latest in Dockerfile.variant but CI must
resolve it to a concrete version string before passing as a build-arg.
Otherwise the build-arg string is byte-identical across releases →
identical layer hash → registry buildcache silently reuses the old
layer. resolve-versions job in the workflow handles this.
Discovered in pi-devbox 2026-05-23 (every release v0.74.0..v0.75.5
shipped the same image bytes); preventatively fixed for PI_VERSION +
PI_FORK_REF + PI_OBSMEM_REF.
Smoke-test gate
scripts/smoke-test.sh runs amd64-only against a freshly-built variant
image. Verifies binaries, repo clones, runtime deployment (waits for
keybindings + mempalace bridge + ≥4 extensions before sampling — fixes
the parallel-build-load race documented in opencode-devbox c6f9d11
2026-06-08), and image size threshold (3500 MB; revisit after a few
releases as actuals settle).
If smoke fails on size threshold but build is otherwise fine: bump
SIZE_THRESHOLD_MB in scripts/smoke-test.sh in a follow-up commit and
re-run. The threshold exists to catch runaway growth (an accidental
texlive bake-in, a forgotten chrome dependency), not to block ordinary
upstream bumps.
Build pipeline notes
- Two-phase: base + variant. Base is rebuilt only when
Dockerfile.base,rootfs/, orentrypoint*.shchange (CI computes a content hash and probes Hub for an existingbase-<hash>tag). base-latestalias is promoted frombase-<hash>viacrane copy(manifest copy, no rebuild) only when the base actually changed.docker buildx build --pushretry: 3 attempts with backoff for transient Hub blips. Deterministic failures fail all 3 and the job fails as expected.- Registry buildcache disabled: buildkit's cache-export hits HTTP 400 on Hub CDN since ~2026-05-23. Image push works fine; we pay the full base build on Dockerfile.base change, but base tags are content- addressed so unchanged bases short-circuit at the probe step.
Decoupling history (briefly)
Pre-v1.0.0 pi-devbox was FROM joakimp/pi-devbox:base-pi-only, where
base-pi-only was a tag built by opencode-devbox CI (with
INSTALL_OPENCODE=false in their variant Dockerfile) and pushed under
the pi-devbox repo as an internal building-block tag. This setup
required rebuilding opencode-devbox before pi-devbox could be tagged
and meant pi-devbox docs needed cross-referencing into opencode-devbox.
v1.0.0 brings pi install logic into this repo, drops the cross-repo
dependency, and the base-pi-only* tags from opencode-devbox become
deprecated artifacts (to be removed in opencode-devbox v2.0.0).
What we DON'T install (and why)
- No texlive (~600 MB–1 GB). Users who need PDF export from pandoc
or pi-studio can install on demand:
sudo apt-get install texlive-xetex texlive-latex-recommended. The planned:latest-studio-texvariant will bake this in. - pi-studio ships in the
:latest-studiovariant (since v1.1.0), vendored to/opt/pi-studioand registered at container start viapi install /opt/pi-studio(see Dockerfile.variantINSTALL_STUDIO). The default:latestimage stays studio-free. Note: pi-studio binds127.0.0.1inside the container, so browser access needs host networking or the bundledstudio-exposebridge (socat; auto-starts whenSTUDIO_EXPOSE=1) — see README "Using pi-studio". - No Julia/R/GHCi/Clojure runtimes. Use
uv run --with Xfor Python REPLs;apt installother-language runtimes ad-hoc per container if needed.
Backward compatibility
- The host
~/.mempalacebind-mount path is unchanged. - Volume names (
devbox-pi-config,devbox-ssh-local,devbox-shell-history,devbox-zoxide,devbox-nvim-data,devbox-uv; optionaldevbox-palace,devbox-chroma-cache) are unchanged. ~/.pi/agent/layout inside the container is unchanged; existing named volumes work without recreation.- The
:latestandvX.Y.ZHub tags continue to point at a "base + pi" image. Same tag, same shape, just built differently.