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
| 1 | FROM node:20 |
| 2 | |
| 3 | ARG TZ |
| 4 | ENV TZ="$TZ" |
| 5 | |
| 6 | # Install basic development tools and iptables/ipset |
| 7 | RUN 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 |
| 25 | RUN mkdir -p /usr/local/share/npm-global && \ |
| 26 | chown -R node:node /usr/local/share |
| 27 | |
| 28 | ARG USERNAME=node |
| 29 | |
| 30 | # Persist bash history. |
| 31 | RUN 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 |
| 37 | ENV DEVCONTAINER=true |
| 38 | |
| 39 | # Create workspace and config directories and set permissions |
| 40 | RUN mkdir -p /workspace /home/node/.claude && \ |
| 41 | chown -R node:node /workspace /home/node/.claude |
| 42 | |
| 43 | WORKDIR /workspace |
| 44 | |
| 45 | 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 | |
| 50 | # Set up non-root user |
| 51 | USER node |
| 52 | |
| 53 | # Install global packages |
| 54 | ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global |
| 55 | ENV PATH=$PATH:/usr/local/share/npm-global/bin |
| 56 | |
| 57 | # Set the default shell to bash rather than sh |
| 58 | ENV SHELL /bin/zsh |
| 59 | |
| 60 | # 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)" -- \ |
| 62 | -p git \ |
| 63 | -p fzf \ |
| 64 | -a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \ |
| 65 | -a "source /usr/share/doc/fzf/examples/completion.zsh" \ |
| 66 | -a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ |
| 67 | -x |
| 68 | |
| 69 | # Install Claude |
| 70 | RUN npm install -g @anthropic-ai/claude-code |
| 71 | |
| 72 | # Copy and set up firewall script |
| 73 | COPY init-firewall.sh /usr/local/bin/ |
| 74 | USER root |
| 75 | RUN chmod +x /usr/local/bin/init-firewall.sh && \ |
| 76 | echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall && \ |
| 77 | chmod 0440 /etc/sudoers.d/node-firewall |
| 78 | USER node |