-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
118 lines (101 loc) · 3.46 KB
/
Dockerfile
File metadata and controls
118 lines (101 loc) · 3.46 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
111
112
113
114
115
116
117
118
FROM node:20@sha256:66d2eb8b463114d1f416d61dbd5fa9cea83e8fc250feb997338467728a06124b
ARG TZ
ENV TZ="$TZ"
# install go
WORKDIR /go
COPY download.sh /usr/local/bin
ARG \
TARGETARCH=amd64 \
# renovate: datasource=github-tags depName=golang packageName=golang/go versioning=go-mod-directive
GO_VERSION=go1.25.3 \
GO_BASE_URL="https://go.dev/dl/${GO_VERSION}" \
GO_AMD64=linux-amd64.tar.gz \
GO_AMD64_SHA256="0335f314b6e7bfe08c3d0cfaa7c19db961b7b99fb20be62b0a826c992ad14e0f" \
GO_ARM64=linux-arm64.tar.gz \
GO_ARM64_SHA256="1d42ebc84999b5e2069f5e31b67d6fc5d67308adad3e178d5a2ee2c9ff2001f5"
RUN --mount=type=cache,id=base-downloads-${TARGETARCH},sharing=locked,target=/opt/downloads \
if [ "${TARGETARCH}" = "amd64" ]; \
then \
download.sh \
--url "${GO_BASE_URL}.${GO_AMD64}" \
--sha256 "${GO_AMD64_SHA256}" \
--dest /usr/local ; \
else \
download.sh \
--url "${GO_BASE_URL}.${GO_ARM64}" \
--sha256 "${GO_ARM64_SHA256}" \
--dest /usr/local ; \
fi
# Install basic development tools and iptables/ipset
RUN apt-get update && apt-get install -y --no-install-recommends \
less \
git \
procps \
sudo \
fzf \
zsh \
man-db \
unzip \
gnupg2 \
gh \
iptables \
ipset \
iproute2 \
dnsutils \
aggregate \
jq \
nano \
vim \
make \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Ensure default node user has access to /usr/local/share
RUN mkdir -p /usr/local/share/npm-global && \
chown -R node:node /usr/local/share && \
mkdir -p /workspace /home/node/.claude && \
chown -R node:node /workspace /home/node/.claude
WORKDIR /workspace
ARG GIT_DELTA_VERSION=0.18.2
RUN ARCH=$(dpkg --print-architecture) && \
wget --progress=dot:giga "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
dpkg -i "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
rm "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb"
# Set up non-root user
USER node
# Install global packages
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
ENV PATH=$PATH:/usr/local/share/npm-global/bin
# Set the default shell to zsh rather than sh
ENV SHELL=/bin/zsh
# Set the default editor and visual
ENV EDITOR=nano
ENV VISUAL=nano
# Default powerline10k theme
ARG ZSH_IN_DOCKER_VERSION=1.2.0
RUN sh -c "$(wget --progress=dot:giga -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
-p git \
-p fzf \
-a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
-a "source /usr/share/doc/fzf/examples/completion.zsh" \
-a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
-x
ARG \
# renovate: datasource=npm depName=@anthropic-ai/claude-code
CLAUDE_CLI_VERSION=v2.0.60 \
# renovate: datasource=npm depName=@google/gemini-cli
GEMINI_CLI_VERSION=v0.19.4
RUN npm install -g @anthropic-ai/claude-code@$CLAUDE_CLI_VERSION
RUN npm install -g @google/gemini-cli@$GEMINI_CLI_VERSION
# Copy and set up firewall script
COPY init-firewall.sh /usr/local/bin/
USER root
RUN chmod +x /usr/local/bin/init-firewall.sh && \
echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall && \
chmod 0440 /etc/sudoers.d/node-firewall
USER node
ENV \
NODE_OPTIONS="--max-old-space-size=4096" \
CLAUDE_CONFIG_DIR="/home/node/.claude" \
POWERLEVEL9K_DISABLE_GITSTATUS="true"
COPY docker-entrypoint.sh /docker-entrypoint.sh
COPY .bash_aliases /home/node/
ENTRYPOINT [ "/docker-entrypoint.sh" ]