-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathDockerfile
More file actions
110 lines (91 loc) · 3.62 KB
/
Dockerfile
File metadata and controls
110 lines (91 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Claude Code Devcontainer
# Based on Microsoft devcontainer image for better devcontainer integration
ARG UV_VERSION=0.10.0
FROM ghcr.io/astral-sh/uv:${UV_VERSION}@sha256:78a7ff97cd27b7124a5f3c2aefe146170793c56a1e03321dd31a289f6d82a04f AS uv
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04@sha256:d94c97dd9cacf183d0a6fd12a8e87b526e9e928307674ae9c94139139c0c6eae
ARG TZ
ENV TZ="$TZ"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install additional system packages (base image already includes git, curl, sudo, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
# Sandboxing support for Claude Code
bubblewrap \
socat \
# Modern CLI tools
fd-find \
ripgrep \
tmux \
zsh \
# Build tools
build-essential \
# Utilities
jq \
nano \
unzip \
vim \
# Network tools (for security testing)
dnsutils \
ipset \
iptables \
iproute2 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install git-delta
ARG GIT_DELTA_VERSION=0.18.2
RUN ARCH=$(dpkg --print-architecture) && \
curl -fsSL "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" -o /tmp/git-delta.deb && \
dpkg -i /tmp/git-delta.deb && \
rm /tmp/git-delta.deb
# Install uv (Python package manager) via multi-stage copy
COPY --from=uv /uv /usr/local/bin/uv
# Install fzf from GitHub releases (newer than apt, includes built-in shell integration)
ARG FZF_VERSION=0.67.0
RUN ARCH=$(dpkg --print-architecture) && \
case "${ARCH}" in \
amd64) FZF_ARCH="linux_amd64" ;; \
arm64) FZF_ARCH="linux_arm64" ;; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \
esac && \
curl -fsSL "https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-${FZF_ARCH}.tar.gz" | tar -xz -C /usr/local/bin
# Create directories and set ownership (combined for fewer layers)
RUN mkdir -p /commandhistory /workspace /home/vscode/.claude /opt && \
touch /commandhistory/.bash_history && \
touch /commandhistory/.zsh_history && \
chown -R vscode:vscode /commandhistory /workspace /home/vscode/.claude /opt
# Set environment variables
ENV DEVCONTAINER=true
ENV SHELL=/bin/zsh
ENV EDITOR=nano
ENV VISUAL=nano
WORKDIR /workspace
# Switch to non-root user for remaining setup
USER vscode
# Set PATH early so claude and other user-installed binaries are available
ENV PATH="/home/vscode/.local/bin:$PATH"
# Install Claude Code natively with marketplace plugins
RUN curl -fsSL https://claude.ai/install.sh | bash && \
claude plugin marketplace add anthropics/skills && \
claude plugin marketplace add trailofbits/skills && \
claude plugin marketplace add trailofbits/skills-curated
# Install Python 3.13 via uv (fast binary download, not source compilation)
RUN uv python install 3.13 --default
# Install ast-grep (AST-based code search)
RUN uv tool install ast-grep-cli
# Install fnm (Fast Node Manager) and Node 22
ARG NODE_VERSION=22
ENV FNM_DIR="/home/vscode/.fnm"
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "$FNM_DIR" --skip-shell && \
export PATH="$FNM_DIR:$PATH" && \
eval "$(fnm env)" && \
fnm install ${NODE_VERSION} && \
fnm default ${NODE_VERSION}
# Install Oh My Zsh
ARG ZSH_IN_DOCKER_VERSION=1.2.1
RUN sh -c "$(curl -fsSL https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
-p git \
-x
# Copy zsh configuration
COPY --chown=vscode:vscode .zshrc /home/vscode/.zshrc.custom
# Append custom zshrc to the main one
RUN echo 'source ~/.zshrc.custom' >> /home/vscode/.zshrc
# Copy post_install script
COPY --chown=vscode:vscode post_install.py /opt/post_install.py