Skip to content

Commit fc95de3

Browse files
committed
Skip permissions in sandboxed containers and fix Docker socket access
Add --dangerously-skip-permissions to claude invocations since these run in isolated VM/container environments. Add --group-add with the VM's Docker socket GID so the container user can access the daemon.
1 parent fdf7918 commit fc95de3

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

bin/claude-docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ if [ -f "${HOME}/.gitconfig" ]; then
2727
DOCKER_ARGS="$DOCKER_ARGS -v ${HOME}/.gitconfig:/work/.gitconfig:ro"
2828
fi
2929

30-
exec docker run $DOCKER_ARGS nemanjan00/dev zsh -ic "cd project ; tmux new-session 'claude $*'"
30+
exec docker run $DOCKER_ARGS nemanjan00/dev zsh -ic "cd project ; tmux new-session 'claude --dangerously-skip-permissions $*'"

bin/claude-vm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939

4040
# Build docker run command
4141
DOCKER_ARGS="-ti -e TERM=xterm-256color"
42-
DOCKER_ARGS="$DOCKER_ARGS -v /var/run/docker.sock:/var/run/docker.sock"
42+
DOCKER_ARGS="$DOCKER_ARGS -v /var/run/docker.sock:/var/run/docker.sock --group-add \$(stat -c '%g' /var/run/docker.sock)"
4343

4444
# Mount project — use /vagrant if PROJECT_DIR is the same as SCRIPT_DIR
4545
if [ "$(realpath "$PROJECT_DIR")" = "$(realpath "$SCRIPT_DIR")" ]; then
@@ -64,4 +64,4 @@ if [ -f "${HOME}/.gitconfig" ]; then
6464
DOCKER_ARGS="$DOCKER_ARGS -v /tmp/.gitconfig:/work/.gitconfig:ro"
6565
fi
6666

67-
vagrant ssh -c "docker run $DOCKER_ARGS nemanjan00/dev zsh -ic 'cd project ; tmux new-session \"claude $*\"'"
67+
vagrant ssh -c "docker run $DOCKER_ARGS nemanjan00/dev zsh -ic 'cd project ; tmux new-session \"claude --dangerously-skip-permissions $*\"'"

vm/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fi
3737
# Build docker run command
3838
DOCKER_ARGS="-ti -e TERM=xterm-256color"
3939
DOCKER_ARGS="$DOCKER_ARGS ${ANTHROPIC_API_KEY:+-e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY}"
40-
DOCKER_ARGS="$DOCKER_ARGS -v /var/run/docker.sock:/var/run/docker.sock"
40+
DOCKER_ARGS="$DOCKER_ARGS -v /var/run/docker.sock:/var/run/docker.sock --group-add \$(stat -c '%g' /var/run/docker.sock)"
4141

4242
# Mount project — use /vagrant if PROJECT_DIR is the same as SCRIPT_DIR
4343
if [ "$(realpath "$PROJECT_DIR")" = "$(realpath "$SCRIPT_DIR")" ]; then

0 commit comments

Comments
 (0)