-
Notifications
You must be signed in to change notification settings - Fork 7
chore(sandbox): Node 24, agent CLIs, persistent config, agent tooling #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,11 @@ FROM ubuntu:24.04 | |
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Ubuntu leaves the locale unset, which makes agent TUIs and Python misrender | ||
| # non-ASCII output. C.UTF-8 is built in, so this needs no locales package. | ||
| # Repeated in /etc/environment below, because ENV does not reach SSH sessions. | ||
| ENV LANG=C.UTF-8 | ||
|
|
||
| # System tools + SSH + Python | ||
| RUN apt-get update && apt-get install -y \ | ||
| openssh-server \ | ||
|
|
@@ -12,19 +17,34 @@ RUN apt-get update && apt-get install -y \ | |
| net-tools iputils-ping \ | ||
| unzip zip \ | ||
| jq \ | ||
| ripgrep fd-find \ | ||
| tmux \ | ||
| sqlite3 tree file fzf \ | ||
| python3 python3-pip python3-venv python3-dev \ | ||
| build-essential \ | ||
| && ln -sf /usr/bin/python3 /usr/bin/python \ | ||
| && ln -sf /usr/bin/pip3 /usr/bin/pip \ | ||
| && ln -sf /usr/bin/fdfind /usr/local/bin/fd \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && mkdir -p /var/run/sshd \ | ||
| && sed -i 's|#\?Port 22$|Port 8023|' /etc/ssh/sshd_config \ | ||
| && sed -i 's|#\?PermitRootLogin.*|PermitRootLogin yes|' /etc/ssh/sshd_config \ | ||
| && sed -i 's|#\?PasswordAuthentication.*|PasswordAuthentication yes|' /etc/ssh/sshd_config | ||
|
|
||
| # GitHub CLI (pinned apt repo with a verified signing key, same pattern as Node | ||
| # below) — agents need it for PR and issue work; plain git cannot do either. | ||
| RUN install -d -m 0755 /etc/apt/keyrings \ | ||
| && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \ | ||
| -o /etc/apt/keyrings/githubcli-archive-keyring.gpg \ | ||
| && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ | ||
| && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \ | ||
| > /etc/apt/sources.list.d/github-cli.list \ | ||
| && apt-get update && apt-get install -y gh \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Node.js (pinned NodeSource apt repo with a verified signing key — no curl | bash). | ||
| # apt then cryptographically verifies the nodejs package against the pinned key. | ||
| ARG NODE_MAJOR=22 | ||
| ARG NODE_MAJOR=24 | ||
| RUN install -d -m 0755 /etc/apt/keyrings \ | ||
| && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ | ||
| -o /etc/apt/keyrings/nodesource.asc \ | ||
|
|
@@ -49,19 +69,47 @@ RUN set -eux; \ | |
| rm -rf /tmp/bun.zip /tmp/bun | ||
| ENV PATH="/root/.bun/bin:$PATH" | ||
|
|
||
| # Claude Code | ||
| RUN install -d -m 0755 /etc/apt/keyrings \ | ||
| && curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \ | ||
| -o /etc/apt/keyrings/claude-code.asc \ | ||
| && echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \ | ||
| > /etc/apt/sources.list.d/claude-code.list \ | ||
| && apt-get update && apt-get install -y claude-code \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| # Claude Code — official installer, always the newest release. | ||
| # Installs the launcher into /root/.local/bin; the installer itself | ||
| # checksum-verifies the binary it downloads. | ||
| # | ||
| # The ADD below is the cache key: its content is the current version string, so | ||
| # Docker re-runs the install exactly when a new release ships and reuses the | ||
| # layer when it hasn't. Kept after the apt/Node/Bun layers on purpose — busting | ||
| # it only reruns the cheap steps that follow. | ||
| ADD https://downloads.claude.ai/claude-code-releases/latest /tmp/claude-code-version | ||
| RUN curl -fsSL https://claude.ai/install.sh | bash \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If Useful? React with 👍 / 👎. |
||
| && rm -f /tmp/claude-code-version | ||
| ENV PATH="/root/.local/bin:$PATH" | ||
|
|
||
| # bunny CLI — this repo, published to npm. No install scripts; the platform | ||
| # binary comes in as an optional dependency. Its config follows | ||
| # XDG_CONFIG_HOME, which is pinned to /workplace below, so credentials persist | ||
| # without any extra wiring. | ||
| ADD https://registry.npmjs.org/@bunny.net/cli/latest /tmp/bunny-cli-version | ||
| RUN npm install -g @bunny.net/cli@latest \ | ||
| && rm -f /tmp/bunny-cli-version | ||
|
|
||
| # Workplace — SSH sessions land here, bun on PATH, Claude config lives here | ||
| ENV CLAUDE_CONFIG_DIR=/workplace/.claude | ||
| # Workplace — SSH sessions land here, and Claude Code, the bunny CLI and gh all | ||
| # keep their config and credentials on the persistent volume (the latter two via | ||
| # XDG_CONFIG_HOME, which they both honour). | ||
| # | ||
| # These have to go in /etc/environment, not just ENV: sshd builds a fresh | ||
| # environment per session, so Docker ENV never reaches an SSH login. pam_env | ||
| # (UsePAM yes) reads this file for both interactive and non-interactive | ||
| # sessions, which is also why PATH is spelled out here — .bashrc alone misses | ||
| # `ssh <host> <cmd>`. ENV is kept as well so `docker exec` and the entrypoint | ||
| # see the same values. | ||
| ENV CLAUDE_CONFIG_DIR=/workplace/.claude \ | ||
| XDG_CONFIG_HOME=/workplace/.config | ||
| RUN mkdir -p /workplace \ | ||
| && printf 'cd /workplace\nexport PATH="/root/.bun/bin:$PATH"\n' >> /root/.bashrc | ||
| && printf '%s\n' \ | ||
| 'PATH=/root/.local/bin:/root/.bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \ | ||
| 'LANG=C.UTF-8' \ | ||
| 'CLAUDE_CONFIG_DIR=/workplace/.claude' \ | ||
| 'XDG_CONFIG_HOME=/workplace/.config' \ | ||
| >> /etc/environment \ | ||
| && printf 'cd /workplace\n' >> /root/.bashrc | ||
|
|
||
| COPY entrypoint.sh /entrypoint.sh | ||
| RUN chmod +x /entrypoint.sh | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ok with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
claude code does a lot of releases so it's a hassle to follow. and since it only effects the new sandboxes it seems fine.