spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

Improve devcontainer Dockerfile following best practicesBrowse files
- Use apt-get instead of apt for better script compatibility
- Add --no-install-recommends to reduce image size
- Add cleanup to remove apt cache
- Parameterize external tool versions with build args
toms74209200 authored on Jul 11, 2025 parent 54a4ed0 · commit f91aed5440fa
2 changed files+13 -7compared with 54a4ed0
M.devcontainer/Dockerfile
M.devcontainer/devcontainer.json
@@ -4,7 +4,8 @@
44 ENV TZ="$TZ"
55
66 # Install basic development tools and iptables/ipset
7-RUN apt update && apt install -y less \
7+RUN apt-get update && apt-get install -y --no-install-recommends \
8+ less \
89 git \
910 procps \
1011 sudo \
@@ -19,7 +20,8 @@
1920 iproute2 \
2021 dnsutils \
2122 aggregate \
22- jq
23+ jq \
24+ && apt-get clean && rm -rf /var/lib/apt/lists/*
2325
2426 # Ensure default node user has access to /usr/local/share
2527 RUN mkdir -p /usr/local/share/npm-global && \
@@ -42,10 +44,11 @@
4244
4345 WORKDIR /workspace
4446
47+ARG GIT_DELTA_VERSION=0.18.2
4548 RUN ARCH=$(dpkg --print-architecture) && \
46- wget "https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_${ARCH}.deb" && \
47- sudo dpkg -i "git-delta_0.18.2_${ARCH}.deb" && \
48- rm "git-delta_0.18.2_${ARCH}.deb"
49+ wget "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
50+ sudo dpkg -i "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
51+ rm "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb"
4952
5053 # Set up non-root user
5154 USER node
@@ -58,7 +61,8 @@
5861 ENV SHELL=/bin/zsh
5962
6063 # Default powerline10k theme
61-RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
64+ARG ZSH_IN_DOCKER_VERSION=1.2.0
65+RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
6266 -p git \
6367 -p fzf \
6468 -a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
@@ -3,7 +3,9 @@
33 "build": {
44 "dockerfile": "Dockerfile",
55 "args": {
6- "TZ": "${localEnv:TZ:America/Los_Angeles}"
6+ "TZ": "${localEnv:TZ:America/Los_Angeles}",
7+ "GIT_DELTA_VERSION": "0.18.2",
8+ "ZSH_IN_DOCKER_VERSION": "1.2.0"
79 }
810 },
911 "runArgs": [