mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 13:15:24 +02:00
fix: run eval container as non-root — claude CLI rejects --dangerously-skip-permissions as root
Claude Code CLI blocks --dangerously-skip-permissions when running as uid=0 for security. Add a 'runner' user to the Docker image and set --user runner on the container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,3 +43,9 @@ RUN bun --version && node --version && claude --version && jq --version && gh --
|
||||
# Save node_modules + package.json snapshot for cache validation at runtime
|
||||
RUN mv /workspace/node_modules /opt/node_modules_cache \
|
||||
&& cp /workspace/package.json /opt/node_modules_cache/.package.json
|
||||
|
||||
# Claude CLI refuses --dangerously-skip-permissions as root.
|
||||
# Create a non-root user for eval runs (GH Actions overrides USER, so
|
||||
# the workflow must set options.user or use gosu/su-exec at runtime).
|
||||
RUN useradd -m -s /bin/bash runner \
|
||||
&& chmod -R a+rX /opt/node_modules_cache
|
||||
|
||||
Reference in New Issue
Block a user