fix(infra): add CMD to Dockerfile and fix credentials mount path in containers-rebuild #28
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/27"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two integration bugs that would each stop the first container from running:
Bug 1 — Dockerfile CMD: The image had no
CMD, sodocker run -d <image>created the container and immediately exited.docker execfails on a stopped container. AddedCMD ["sleep", "infinity"]to keep the container alive.Bug 2 — Credentials mount path:
just containers-rebuildhad two path mismatches:~/.config/claude-hooks/credentials/$name/.credentials.json; now readsagents.$name.container.credentials_host_pathfromagents.jsonwith the same default asdefaultHostCredentialsPath()incontainer.ts(~/.config/claude-hooks/claude-credentials/.credentials.json)/root/.claude/.credentials.json(wrong user, wrong path); now mounts to/home/claude/.config/claude-code/.credentials.jsonwhich matchesCONTAINER_CREDENTIALS_TARGETincontainer.tsAlso:
just containers-smoke <name>recipe for round-trip verification (bun --version+bun /opt/claude-code/cli.js --version)CONTAINER_CREDENTIALS_TARGETvalue anddefaultHostCredentialsPath()to catch future justfile/container.tsdriftCloses #27
All acceptance criteria met, CI green (run #1522, 58s).
Bug 1 — Dockerfile CMD ✅
CMD ["sleep", "infinity"]correctly appended. Container will now stay alive afterdocker run -d, allowingdocker execto work.Bug 2a — Container-side mount path ✅
/root/.claude/.credentials.json→/home/claude/.config/claude-code/.credentials.json. MatchesCONTAINER_CREDENTIALS_TARGETexactly. The justfile comment pointing to the constant is a nice touch.Bug 2b — Host-side credentials path ✅
jq -r ... '// empty'+ bash${creds_file:-$default_creds}is the correct pattern:// emptysuppressesnulloutput so the shell fallback fires cleanly. Default path matchesdefaultHostCredentialsPath()character-for-character.Tests ✅
Both new tests pin concrete string values rather than just structural checks — exactly the right call for a cross-boundary contract like a justfile mount. Future constant drift will immediately produce a legible failure with the fix in the error message.
Smoke recipe ✅
just containers-smoke <name>matches the AC's required invocation. The two-step check (bun runtime + CLI binary) is exactly what's needed to validate the image is well-formed before enabling container mode.README ✅
Step-by-step pilot guide is complete and covers all required steps: credentials provisioning, local image build, container creation, smoke test,
agents.jsonflag, and service restart.Review: fix(infra): container integration fixes
CI: ✅ green — run #1522, success, 58s on head
7a9a275.Acceptance criteria check (issue #27)
CMD ["sleep", "infinity"]added at end of Dockerfilecontainers-rebuildmounts creds to exactCONTAINER_CREDENTIALS_TARGETpath/root/.claude/.credentials.json→/home/claude/.config/claude-code/.credentials.json:roagents.jsonwith same fallback asdefaultHostCredentialsPath()jqreadsagents.$n.container.credentials_host_path // empty, fallback is~/.config/claude-hooks/claude-credentials/.credentials.json— matchescontainer.tscontainer.test.tspins recipe/container-path agreementCONTAINER_CREDENTIALS_TARGET+defaultHostCredentialsPath()return valuejust containers-smoke NAMEadded, runsbun --version+bun /opt/claude-code/cli.js --versioncontainers-rebuild, smoke test,agents.jsonopt-in, service restartCode quality notes
jqfallback pattern (// empty+ bash${creds_file:-$default}) is idiomatic and correct.# Target path must match CONTAINER_CREDENTIALS_TARGET in src/container.tsin the justfile is exactly the right cross-reference to leave for maintainers.No issues found. All criteria met, code is correct and safe.