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

claude-code / .devcontainer / Dockerfile
77 lines · 2.0 KBRaw
1FROM node:20
2
3ARG TZ
4ENV TZ="$TZ"
5
6# Install basic development tools and iptables/ipset
7RUN apt update && apt install -y less \
8 git \
9 procps \
10 sudo \
11 fzf \
12 zsh \
13 man-db \
14 unzip \
15 gnupg2 \
16 gh \
17 iptables \
18 ipset \
19 iproute2 \
20 dnsutils \
21 aggregate \
22 jq
23
24# Ensure default node user has access to /usr/local/share
25RUN mkdir -p /usr/local/share/npm-global && \
26 chown -R node:node /usr/local/share
27
28ARG USERNAME=node
29
30# Persist bash history.
31RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
32 && mkdir /commandhistory \
33 && touch /commandhistory/.bash_history \
34 && chown -R $USERNAME /commandhistory
35
36# Set `DEVCONTAINER` environment variable to help with orientation
37ENV DEVCONTAINER=true
38
39# Create workspace and config directories and set permissions
40RUN mkdir -p /workspace /home/node/.claude && \
41 chown -R node:node /workspace /home/node/.claude
42
43WORKDIR /workspace
44
45RUN wget https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_arm64.deb && \
46 sudo dpkg -i git-delta_0.18.2_arm64.deb && \
47 rm git-delta_0.18.2_arm64.deb
48
49# Set up non-root user
50USER node
51
52# Install global packages
53ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
54ENV PATH=$PATH:/usr/local/share/npm-global/bin
55
56# Set the default shell to bash rather than sh
57ENV SHELL /bin/zsh
58
59# Default powerline10k theme
60RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
61 -p git \
62 -p fzf \
63 -a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
64 -a "source /usr/share/doc/fzf/examples/completion.zsh" \
65 -a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
66 -x
67
68# Install Claude
69RUN npm install -g @anthropic-ai/claude-code
70
71# Copy and set up firewall script
72COPY init-firewall.sh /usr/local/bin/
73USER root
74RUN chmod +x /usr/local/bin/init-firewall.sh && \
75 echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall && \
76 chmod 0440 /etc/sudoers.d/node-firewall
77USER node