Add custom env vars and Claude instructions for projects
Support per-project environment variables injected into containers, plus global and per-project Claude Code instructions written to ~/.claude/CLAUDE.md inside the container on start. Reserved env var prefixes are blocked, and changes trigger automatic container recreation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,14 @@ if [ -n "$GIT_USER_EMAIL" ]; then
|
||||
su -s /bin/bash claude -c "git config --global user.email '$GIT_USER_EMAIL'"
|
||||
fi
|
||||
|
||||
# ── Claude instructions ──────────────────────────────────────────────────────
|
||||
if [ -n "$CLAUDE_INSTRUCTIONS" ]; then
|
||||
mkdir -p /home/claude/.claude
|
||||
printf '%s\n' "$CLAUDE_INSTRUCTIONS" > /home/claude/.claude/CLAUDE.md
|
||||
chown claude:claude /home/claude/.claude/CLAUDE.md
|
||||
unset CLAUDE_INSTRUCTIONS
|
||||
fi
|
||||
|
||||
# ── Docker socket permissions ────────────────────────────────────────────────
|
||||
if [ -S /var/run/docker.sock ]; then
|
||||
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
|
||||
|
||||
Reference in New Issue
Block a user