# Sample image for running agengo and its coding agents inside a container.
# Copy this folder to `.devcontainer/` in your repository and add your
# project's own toolchain (Rust, Python, ...) below.
FROM node:22-bookworm
ARG TZ=UTC
ENV TZ="$TZ"
# git for agengo (2.31 or newer), iptables and ipset for the firewall.
# bubblewrap and socat are left out on purpose: the container is the boundary,
# and Claude Code's own sandbox does not run in an unprivileged container.
RUN apt-get update && apt-get install -y --no-install-recommends \
git ca-certificates curl jq sudo procps iptables ipset iproute2 dnsutils aggregate \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# The coding agents and agengo. Remove the ones you do not use.
# Antigravity (`agy`) is not installed here: add its installer if you use it,
# and its hosts to allowed-domains.txt.
RUN npm install -g @anthropic-ai/claude-code @openai/codex agengo
# The `node` user may run the firewall script, and nothing else, as root.
COPY init-firewall.sh /usr/local/bin/init-firewall.sh
COPY allowed-domains.txt /usr/local/etc/allowed-domains.txt
RUN chmod 755 /usr/local/bin/init-firewall.sh \
&& echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall \
&& chmod 0440 /etc/sudoers.d/node-firewall \
&& mkdir -p /workspace /home/node/.claude /home/node/.codex \
&& chown -R node:node /workspace /home/node/.claude /home/node/.codex
USER node
WORKDIR /workspace