# PEP-17/40: the runner image — the agent of one runner (Claude Code, Codex, OpenCode) with # git and common build tools, and Peppa's shims (peppa-hook, peppa-mcp) that reach Peppa only # through the agent relay. Same image on Peppa's machine and on runner hosts. # Build: scripts/runner-image.sh (tag: $PEPPA_RUNNER_IMAGE, default peppa/runner:latest) # PEP-314: Go and PostgreSQL 18 of FORGE Default Stack — the agent builds and tests a Go service with # a database right here (template .gitea/peppa-tools.sh starts a throwaway cluster). The smoke test # of scripts/runner-image.sh checks `go version` against GO_VERSION, psql and initdb. ARG GO_VERSION=1.27 FROM golang:${GO_VERSION}-bookworm AS go FROM node:22-bookworm-slim ARG GO_VERSION ARG PG_MAJOR=18 # PEP-267: versions are pinned in infra/agent-versions.json (a test keeps these defaults equal to it); # a new one only through scripts/runner-image.sh --try (smoke test first). ARG CLAUDE_CODE_VERSION=2.1.330 ARG CODEX_VERSION=0.171.0 ARG OPENSPEC_VERSION=2.0.0 ARG OPENCODE_VERSION=1.19.6 ARG PNPM_VERSION=10 RUN apt-get update \ && apt-get install -y --no-install-recommends git ca-certificates curl ripgrep jq less procps python3 make g++ unzip \ && rm -rf /var/lib/apt/lists/* # PEP-314: PostgreSQL from PGDG — the same major version as the stands (postgres:18); no cluster on install. # libnss-wrapper: the agent runs as --user with no /etc/passwd entry, and initdb refuses an unknown # user — .gitea/peppa-tools.sh gives the database commands a temporary passwd (as the official postgres image). RUN curl -fsSL -o /usr/share/keyrings/pgdg.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc \ && echo "deb [signed-by=/usr/share/keyrings/pgdg.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ && mkdir -p /etc/postgresql-common/createcluster.d \ && echo "create_main_cluster = false" > /etc/postgresql-common/createcluster.d/peppa.conf \ && apt-get update \ && apt-get install -y --no-install-recommends "postgresql-${PG_MAJOR}" "postgresql-client-${PG_MAJOR}" libnss-wrapper \ && rm -rf /var/lib/apt/lists/* COPY --from=go /usr/local/go /usr/local/go RUN npm install -g --no-fund --no-audit \ "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" \ "@openai/codex@${CODEX_VERSION}" \ "opencode-ai@${OPENCODE_VERSION}" \ "pnpm@${PNPM_VERSION}" \ "@fission-ai/openspec@${OPENSPEC_VERSION}" \ && npm cache clean --force COPY peppa-agent.mjs bin/peppa-hook bin/peppa-mcp /usr/local/bin/ RUN chmod 755 /usr/local/bin/peppa-hook /usr/local/bin/peppa-mcp \ # The runner runs as the host user (--user uid:gid): repos are owned by someone "else". && git config --system safe.directory '*' \ && git config --system init.defaultBranch main \ && mkdir -p /peppa/home /peppa/run && chmod 1777 /peppa/home # PEP-267: no CLI updates itself (Codex — check_for_update_on_startup=false in the launch, providers.ts). ENV HOME=/peppa/home \ PATH=/usr/local/go/bin:/usr/lib/postgresql/${PG_MAJOR}/bin:$PATH \ DISABLE_AUTOUPDATER=1 \ OPENCODE_DISABLE_AUTOUPDATE=1 \ CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 WORKDIR /peppa/home LABEL org.opencontainers.image.title="peppa-runner" quest.telecom.peppa.component="runner" \ quest.telecom.peppa.cli.claude="${CLAUDE_CODE_VERSION}" quest.telecom.peppa.cli.codex="${CODEX_VERSION}" quest.telecom.peppa.cli.opencode="${OPENCODE_VERSION}" \ quest.telecom.peppa.tool.go="${GO_VERSION}" quest.telecom.peppa.tool.postgres="${PG_MAJOR}"