[nomad-step-4] S4-fix-6 — bake Claude CLI into agents Docker image (remove host bind-mount) #984

Closed
opened 2026-04-18 05:30:36 +00:00 by dev-bot · 0 comments
Collaborator

Step 4 verification: agents crash FATAL: claude CLI not found in PATH. The Claude Code CLI is the agent runtime regardless of LLM backend (llama or Claude API). Currently host-mounted via compose; Nomad jobspec needs it self-contained.

Decision

Bake Claude CLI into the Docker image (option B). No host dependency, reproducible from clone.

Fix

In docker/agents/Dockerfile, add after the existing tool installs:

# Install Claude Code CLI — agent runtime for all LLM backends (llama, Claude API).
# The CLI is the execution environment; ANTHROPIC_BASE_URL selects the model provider.
RUN npm install -g @anthropic-ai/claude-code

Then remove the host bind-mount from nomad/jobs/agents.hcl if one exists (it shouldn't since the jobspec was created fresh, but verify).

Also remove the corresponding host bind-mount from docker-compose.yml's agents service:

# REMOVE this line (Claude CLI now baked into image):
- /home/johba/.local/share/claude/versions/2.1.84:/usr/local/bin/claude:ro

This makes both docker-compose AND Nomad backends use the same self-contained image. No host path coupling.

Side effects

  • Image size increases ~100MB (node_modules for claude-code).
  • Claude CLI version is pinned at build time, not at host-install time. Pin explicitly: npm install -g @anthropic-ai/claude-code@2.1.84 (or latest).
  • Docker-compose stack on disinto-dev-box will use the baked binary on next docker compose build — test that the factory still works after the rebuild.

Acceptance criteria

  • docker build -t disinto/agents:local -f docker/agents/Dockerfile . succeeds.
  • docker run --rm disinto/agents:local claude --version returns the CLI version.
  • Nomad-deployed agents alloc starts without FATAL: claude CLI not found.
  • Live docker-compose stack on disinto-dev-box still works after rebuild (existing bind-mount removed, baked binary used).
  • nomad alloc logs <agents> shows Agent container starting + polling iterations.

Labels / meta

  • backlog + bug-report.
Step 4 verification: agents crash `FATAL: claude CLI not found in PATH`. The Claude Code CLI is the agent runtime regardless of LLM backend (llama or Claude API). Currently host-mounted via compose; Nomad jobspec needs it self-contained. ## Decision Bake Claude CLI into the Docker image (option B). No host dependency, reproducible from clone. ## Fix In `docker/agents/Dockerfile`, add after the existing tool installs: ```dockerfile # Install Claude Code CLI — agent runtime for all LLM backends (llama, Claude API). # The CLI is the execution environment; ANTHROPIC_BASE_URL selects the model provider. RUN npm install -g @anthropic-ai/claude-code ``` Then **remove** the host bind-mount from `nomad/jobs/agents.hcl` if one exists (it shouldn't since the jobspec was created fresh, but verify). Also remove the corresponding host bind-mount from `docker-compose.yml`'s agents service: ```yaml # REMOVE this line (Claude CLI now baked into image): - /home/johba/.local/share/claude/versions/2.1.84:/usr/local/bin/claude:ro ``` This makes both docker-compose AND Nomad backends use the same self-contained image. No host path coupling. ## Side effects - Image size increases ~100MB (node_modules for claude-code). - Claude CLI version is pinned at build time, not at host-install time. Pin explicitly: `npm install -g @anthropic-ai/claude-code@2.1.84` (or latest). - Docker-compose stack on disinto-dev-box will use the baked binary on next `docker compose build` — test that the factory still works after the rebuild. ## Acceptance criteria - `docker build -t disinto/agents:local -f docker/agents/Dockerfile .` succeeds. - `docker run --rm disinto/agents:local claude --version` returns the CLI version. - Nomad-deployed agents alloc starts without `FATAL: claude CLI not found`. - Live docker-compose stack on disinto-dev-box still works after rebuild (existing bind-mount removed, baked binary used). - `nomad alloc logs <agents>` shows `Agent container starting` + polling iterations. ## Labels / meta - `backlog` + `bug-report`.
dev-bot added the
backlog
bug-report
labels 2026-04-18 05:30:36 +00:00
dev-qwen2 self-assigned this 2026-04-18 05:31:32 +00:00
dev-qwen2 added
in-progress
and removed
backlog
labels 2026-04-18 05:31:32 +00:00
dev-qwen2 was unassigned by dev-qwen 2026-04-18 05:56:42 +00:00
dev-qwen removed the
in-progress
label 2026-04-18 05:56:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#984
No description provided.