| 1 | 1 | | # syntax=docker/dockerfile:1.7 |
| 2 | 2 | | # |
| 3 | 3 | | # g1t-runner-base: everything a g1t sandbox has apart from the g1t runner |
| 4 | | − | # itself. Agents, checks, the merge queue, workflow jobs and g1t.page |
| 4 | + | # itself. Checks, the merge queue, workflow jobs and g1t.page |
| 5 | 5 | | # builds all run in it: git, Node, Python, Go, Rust (with the formatter, |
| 6 | 6 | | # the linter, and the wasm32 and musl targets), Java (Temurin 21), .NET |
| 7 | 7 | | # (SDK 8), Ruby (3.3), the usual build tools, Docker (Engine, Buildx, |
| 8 | | − | # Compose), and the Claude Code CLI. |
| 8 | + | # Compose). |
| 9 | 9 | | # |
| 10 | 10 | | # Built and pushed by `node scripts/deploy.mjs build-base` (by hand, or by |
| 11 | 11 | | # .g1t/workflows/runner-base.yml), which records what it pushed in |
| 12 | 12 | | # services/runner/base.json. The runner's own image |
| 13 | 13 | | # (services/runner/Dockerfile) is this plus one file, so a change to the |
| 14 | | − | # runner builds in seconds. docs/DEPLOYING.md explains the two. |
| 14 | + | # runner builds in seconds. The deploy-to-cloudflare guide explains the two. |
| 15 | 15 | | # |
| 16 | 16 | | # Layers go from what changes least to what changes most: the system's |
| 17 | | − | # packages, Docker, then Go, then Rust, then Java, .NET and Ruby, then the |
| 18 | | − | # Claude Code CLI on top, so a new CLI version rebuilds and pushes one |
| 19 | | − | # layer. |
| 17 | + | # packages, Docker, then Go, then Rust, then Java, .NET and Ruby. |
| 20 | 18 | | # |
| 21 | 19 | | # Java and Ruby live in the runner's tool cache (RUNNER_TOOL_CACHE, |
| 22 | 20 | | # /home/runner/_tool), laid out as the setup actions look for them, so |
| ⋯ |
| 100 | 98 | | && rm -rf /tmp/go.tgz /usr/local/go/test /usr/local/go/api /usr/local/go/doc \ |
| 101 | 99 | | && ln -s /usr/local/go/bin/go /usr/local/go/bin/gofmt /usr/local/bin/ |
| 102 | 100 | | |
| 103 | | − | # Claude Code refuses to skip permission prompts as root. |
| 101 | + | # Install the Rust toolchain for the unprivileged job user. |
| 104 | 102 | | USER node |
| 105 | 103 | | ENV HOME=/home/node |
| 106 | 104 | | ENV PATH=/home/node/.cargo/bin:/home/node/go/bin:$PATH |
| ⋯ |
| 191 | 189 | | && touch "$prefix.complete" \ |
| 192 | 190 | | && chown -R node:node "/home/runner/_tool/Ruby" |
| 193 | 191 | | ENV PATH=${JAVA_HOME}/bin:/home/runner/_tool/Ruby/${RUBY_VERSION}/x64/bin:$PATH |
| 194 | | − | |
| 195 | | − | USER node |
| 196 | 192 | | |
| 197 | | − | # Commits are the g1t agent's; the harness does not sign them as its own. |
| 198 | | − | RUN mkdir -p /home/node/.claude \ |
| 199 | | − | && echo '{"includeCoAuthoredBy": false}' > /home/node/.claude/settings.json |
| 200 | | − | |
| 201 | | − | # The Claude Code CLI, pinned, on top: it changes most often of anything |
| 202 | | − | # here, and is one layer to rebuild and push. |
| 203 | | − | ARG CLAUDE_CODE_VERSION=2.1.291 |
| 204 | | − | USER root |
| 205 | | − | # npm's cache stays in BuildKit's cache, out of the image. |
| 206 | | − | RUN --mount=type=cache,target=/tmp/npm-cache \ |
| 207 | | − | npm install --global --no-audit --no-fund --cache /tmp/npm-cache "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" \ |
| 208 | | − | && claude --version |
| 209 | 193 | | USER node |