Skip to content

Commit b2a73fa

Browse files
author
ide-coder
committed
fix: restore PATH in VS Code terminal for go/ruby/java commands
VS Code terminal is a non-login shell that resets PATH, overriding Docker ENV settings. Add PATH restoration to .bashrc to ensure go, ruby, java and other tools are accessible.
1 parent 9e3ec68 commit b2a73fa

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,13 @@ RUN /opt/conda/bin/conda config --set show_channel_urls yes
182182
# npm config (already configured in Layer 5)
183183
RUN mkdir -p /home/coder/.npm
184184

185-
# Add rbenv initialization to .bashrc
186-
RUN echo 'eval "$(/home/coder/.rbenv/bin/rbenv init - bash)"' >> /home/coder/.bashrc
185+
# Add PATH restoration and rbenv initialization to .bashrc
186+
# VS Code terminal is non-login shell, only .bashrc is read
187+
RUN echo '# Restore Docker ENV PATH (VS Code terminal resets PATH)\n\
188+
export PATH=/home/coder/.rbenv/bin:/home/coder/.rbenv/shims:/opt/temurin-21-jdk/bin:/opt/conda/bin:/usr/local/go/bin:/home/coder/go/bin:$PATH\n\
189+
\n\
190+
# Initialize rbenv\n\
191+
eval "$(/home/coder/.rbenv/bin/rbenv init - bash)"' > /home/coder/.bashrc
187192

188193
# Set ownership for coder user
189194
RUN chown -R coder:coder /home/coder \

0 commit comments

Comments
 (0)