Skip to content

Commit ffa1c40

Browse files
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! !fixup Introduce devcontainer service container based development environment (#705)
1 parent cdc0490 commit ffa1c40

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

docker/react_ui_devcontainer/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ COPY --chmod=+x files/usr/local/bin/claude /usr/local/bin/claude
9898
COPY --chmod=+x files/usr/local/bin/opencode /usr/local/bin/opencode
9999
COPY --chmod=+x files/usr/local/bin/docker-entrypoint /usr/local/bin/docker-entrypoint
100100
COPY --chmod=+x files/home/$USERNAME/shell-init.sh ${HOME}/shell-init.sh
101+
COPY --chmod=+x files/home/$USERNAME/shell-init.fish ${HOME}/shell-init.fish
101102

102103
# Wrapper scripts that execute commands inside the appropriate Docker containers.
103104
# These scripts use Docker-from-Docker to run the commands in the context of the
@@ -113,9 +114,9 @@ RUN mkdir -p $HOME/.config/fish && \
113114
echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bashrc && \
114115
echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.zshrc && \
115116
echo 'set -gx PATH /usr/local/bin $PATH' >> $HOME/.config/fish/config.fish && \
116-
echo '$HOME/shell-init.sh' >> $HOME/.bashrc && \
117-
echo '$HOME/shell-init.sh' >> $HOME/.zshrc && \
118-
echo '$HOME/shell-init.sh' >> $HOME/.config/fish/config.fish
117+
echo '. $HOME/shell-init.sh' >> $HOME/.bashrc && \
118+
echo '. $HOME/shell-init.sh' >> $HOME/.zshrc && \
119+
echo 'source $HOME/shell-init.fish' >> $HOME/.config/fish/config.fish
119120

120121
# Set the default working directory when starting a container from this image
121122
WORKDIR /workspace
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env fish
2+
3+
# Block SSH agent forwarding if the environment variable `BLOCK_SSH_AUTH_SOCK` is set to "true"
4+
#
5+
# VS Code forwards the SSH agent socket to the dev container by default, so this allows users
6+
# to opt out of that behavior if they want to disable SSH agent forwarding to isolate the dev container.
7+
# JetBrains IDEs forward the SSH agent socket only if allowed by the user.
8+
if test "$BLOCK_SSH_AUTH_SOCK" = "true"
9+
# Disable SSH agent forwarding for the current shell session
10+
set -gx SSH_AUTH_SOCK /dev/null
11+
# Remove any existing SSH agent socket files created by VS Code
12+
find /tmp -maxdepth 1 -name 'vscode-ssh-auth-*.sock' -delete 2>/dev/null
13+
end

0 commit comments

Comments
 (0)