peppa/infra/runner/Dockerfile

42 lines
2.0 KiB
Docker

# 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)
FROM node:22-bookworm-slim
# 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 <cli> <version> (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/*
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 \
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}"