Skip to content

Commit 231e6f7

Browse files
gatezhclaude
andcommitted
feat(claude-code): bake rtk and ralphex into the image
Install rtk and ralphex from GitHub Releases at build time so projects don't need to pin versions in .mise.toml. Like Claude Code itself, these are dev infrastructure refreshed on each daily rebuild. Update README: simplify .mise.toml example to only pin bun/hugo, add rtk/ralphex row to "What's Included" table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 392428c commit 231e6f7

2 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎claude-code/.devcontainer/Dockerfile‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,28 @@ RUN mkdir -p /home/node/.config/fish \
9797
ENV PATH="/home/node/.local/share/mise/shims:$PATH"
9898
ENV MISE_TRUSTED_CONFIG_PATHS="/workspace"
9999

100+
# ── Dev tools (always latest) ─────────────────────────────────────────────────
101+
# rtk (token-optimized CLI proxy) and ralphex (autonomous plan execution).
102+
# Like Claude Code itself, these are dev infrastructure — not project dependencies.
103+
# Downloaded from GitHub Releases; refreshed on each daily image rebuild.
104+
USER root
105+
RUN set -eux; \
106+
ARCH="$(uname -m)"; \
107+
# ── rtk ──
108+
case "$ARCH" in \
109+
x86_64) RTK_TARGET="x86_64-unknown-linux-musl" ;; \
110+
aarch64) RTK_TARGET="aarch64-unknown-linux-gnu" ;; \
111+
esac; \
112+
RTK_VERSION=$(curl -fsSL https://api.github.com/repos/rtk-ai/rtk/releases/latest | jq -r '.tag_name' | sed 's/^v//'); \
113+
curl -fsSL "https://github.com/rtk-ai/rtk/releases/download/v${RTK_VERSION}/rtk-${RTK_TARGET}.tar.gz" \
114+
| tar -xz -C /usr/local/bin rtk; \
115+
# ── ralphex ──
116+
RALPHEX_ARCH=$(echo "$ARCH" | sed 's/x86_64/amd64/;s/aarch64/arm64/'); \
117+
RALPHEX_VERSION=$(curl -fsSL https://api.github.com/repos/umputun/ralphex/releases/latest | jq -r '.tag_name' | sed 's/^v//'); \
118+
curl -fsSL "https://github.com/umputun/ralphex/releases/download/v${RALPHEX_VERSION}/ralphex_${RALPHEX_VERSION}_linux_${RALPHEX_ARCH}.tar.gz" \
119+
| tar -xz -C /usr/local/bin ralphex
120+
USER node
121+
100122
# ── Playwright (headless shell for browser testing) ───────────────────────────
101123
# Two-layer strategy for multi-project compatibility:
102124
# 1. System deps (install-deps) — heavy, needs root, version-stable across

‎claude-code/README.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Projects consume these pre-built images and control their own tool versions via
1919
| Shell | Fish, Starship, fzf | Built-in syntax highlighting, autosuggestions, completions |
2020
| Tools | git-delta, gh CLI, jq, nano, vim, wget, unzip, less, man-db, procps | Standard dev utilities |
2121
| Mise | The tool manager itself (not the tools) | Projects run `mise install` at container creation for their tool versions |
22+
| rtk, ralphex | Always-latest from GitHub Releases | Dev infrastructure (like Claude Code) — no version pinning needed in projects |
2223
| Claude Code | npm global install | npm avoids rate limiting that affects the native installer in parallel CI builds |
2324
| Playwright | System deps + browser binary at a pinned version | See [Playwright version strategy](#playwright-version-strategy) |
2425

@@ -83,7 +84,7 @@ Add to your project's `.devcontainer/devcontainer.json`:
8384

8485
```jsonc
8586
{
86-
"name": "Claude Sandbox",
87+
"name": "Claude Code Sandbox",
8788
"image": "ghcr.io/gatezh/devcontainer-images/claude-code-sandbox:latest",
8889
// Capabilities required for iptables firewall setup
8990
"capAdd": ["NET_ADMIN", "NET_RAW"],
@@ -99,7 +100,7 @@ Add to your project's `.devcontainer/devcontainer.json`:
99100
"source=${localWorkspaceFolder}/.devcontainer/claude-sandbox/init-firewall.sh,target=/usr/local/bin/init-firewall.sh,type=bind"
100101
],
101102
"containerEnv": {
102-
"TZ": "${localEnv:TZ:America/Los_Angeles}",
103+
"TZ": "${localEnv:TZ:America/Edmonton}",
103104
"DEVCONTAINER": "true",
104105
"NODE_OPTIONS": "--max-old-space-size=4096",
105106
"CLAUDE_CONFIG_DIR": "/home/node/.claude",
@@ -121,15 +122,15 @@ Projects consuming these images need the following files in their repository.
121122

122123
### Required: `.mise.toml` (project root)
123124

124-
Each project defines its own tool versions:
125+
Only pin tools that affect project stability — dev infrastructure (rtk, ralphex, Claude Code) is pre-installed in the image at latest:
125126

126127
```toml
128+
# Pin runtime and build tools that affect project stability.
129+
# node is provided by the base image — needed for VS Code extensions
130+
# (OXC, Playwright, etc.) that spawn node. Do not add it here.
127131
[tools]
128132
bun = "1.3.8"
129-
# node is provided by the base image (node:24-trixie-slim).
130-
# This entry is for CI environments where the base image isn't available.
131-
# Inside the devcontainer, mise detects Node is already on $PATH and skips installation.
132-
node = "24"
133+
hugo = "0.155.1"
133134
```
134135

135136
### Optional: `.devcontainer/init-plugins.sh`

0 commit comments

Comments
 (0)