| 1 | # The sandbox a hosted attempt runs in: git, the agent, the g1t runner, and |
| 2 | # the toolchains an agent needs to build and test what it changes. |
| 3 | # Build context: the repository root. |
| 4 | |
| 5 | # The same Debian release as the runtime image, so glibc matches. |
| 6 | FROM rust:1-slim-bookworm AS build |
| 7 | WORKDIR /src |
| 8 | COPY Cargo.toml Cargo.lock ./ |
| 9 | COPY crates crates |
| 10 | COPY services services |
| 11 | RUN cargo build --release --package g1t-runner |
| 12 | |
| 13 | FROM node:22-bookworm-slim |
| 14 | RUN apt-get update \ |
| 15 | && apt-get install -y --no-install-recommends \ |
| 16 | git ca-certificates curl build-essential pkg-config libssl-dev \ |
| 17 | python3 python3-pip python3-venv golang-go ripgrep jq \ |
| 18 | && rm -rf /var/lib/apt/lists/* \ |
| 19 | && npm install --global @anthropic-ai/claude-code \ |
| 20 | && mkdir /work && chown node:node /work |
| 21 | COPY --from=build /src/target/release/g1t-runner /usr/local/bin/g1t-runner |
| 22 | # Claude Code refuses to skip permission prompts as root. |
| 23 | USER node |
| 24 | ENV HOME=/home/node |
| 25 | # Rust, for the agent's own use, installed for the user it runs as. |
| 26 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ |
| 27 | | sh -s -- -y --profile minimal --default-toolchain stable |
| 28 | ENV PATH=/home/node/.cargo/bin:$PATH |
| 29 | ENTRYPOINT ["g1t-runner"] |