Skip to content

Commit b3e439c

Browse files
committed
Add Docker CLI support to development environment
- Install Docker CLI in devcontainer for MCP tool access - Add Docker socket volume mount in docker-compose - Configure ubuntu user with docker group permissions - Enables running containerized MCP tools from Claude Code
1 parent 5b22ae7 commit b3e439c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ RUN curl -fsSL https://claude.ai/install.sh | bash && \
1818
echo 'export PATH="$HOME/.local/bin:$HOME/bin:$PATH"' >> /root/.bashrc && \
1919
echo 'export PATH="$HOME/.local/bin:$HOME/bin:$PATH"' >> /root/.zshrc
2020

21+
# Install Docker CLI using official Docker repository
22+
RUN install -m 0755 -d /etc/apt/keyrings && \
23+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
24+
chmod a+r /etc/apt/keyrings/docker.asc && \
25+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
26+
apt-get update && \
27+
apt-get install -y docker-ce-cli && \
28+
rm -rf /var/lib/apt/lists/*
29+
2130
# Install AWS CLI
2231
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
2332
&& unzip awscliv2.zip \
@@ -66,7 +75,10 @@ RUN mkdir -p /root/.shell_history && \
6675
# Configure existing ubuntu user for Claude Code compatibility (use existing UID 1000)
6776
RUN usermod --shell /bin/zsh ubuntu && \
6877
# Give ubuntu sudo access
69-
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
78+
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
79+
# Add ubuntu user to docker group for Docker socket access
80+
groupadd -f docker && \
81+
usermod -aG docker ubuntu
7082

7183
# Switch to ubuntu user and set up user-specific configurations
7284
USER ubuntu

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
- github-cli-auth:/home/ubuntu/.config/gh
1313
- ${PWD}/.claude:/home/ubuntu/.claude:cached
1414
- ${HOME}/.claude.json:/home/ubuntu/.claude.json:cached
15+
- /var/run/docker.sock:/var/run/docker.sock
1516
working_dir: /workspace
1617
command: sleep infinity
1718
depends_on:

0 commit comments

Comments
 (0)