-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
177 lines (162 loc) · 7.02 KB
/
Dockerfile
File metadata and controls
177 lines (162 loc) · 7.02 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
FROM ubuntu:latest
# =============================================================================
# VERSION CONFIGURATION
# =============================================================================
ARG NODE_VERSION=24.0.0
ARG BUN_VERSION=1.3.9
ARG GO_VERSION=1.23.4
ARG RUST_VERSION=1.83.0
ARG JAVA_VERSION=21
ARG DOTNET_VERSION=8.0
ARG RUBY_VERSION=3.3
# =============================================================================
# INSTALL FLAGS
# =============================================================================
ARG INSTALL_BUN=false
ARG INSTALL_RUST=false
ARG INSTALL_GO=false
ARG INSTALL_JAVA=false
ARG INSTALL_DOTNET=false
ARG INSTALL_RUBY=false
ARG INSTALL_BROWSERS=false
ARG INSTALL_CODING_AGENTS=false
ARG LANGUAGES=""
# Base dependencies
RUN apt-get update && apt-get install -y \
curl ca-certificates build-essential git \
&& rm -rf /var/lib/apt/lists/*
# Node.js (always installed)
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
arm64) ARCH='arm64';; \
esac; \
curl --proto '=https' --tlsv1.2 -fsSLO --compressed "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-$ARCH.tar.xz" && \
tar -xJf node-v${NODE_VERSION}-linux-$ARCH.tar.xz -C /usr/local --strip-components=1 --no-same-owner && \
rm node-v${NODE_VERSION}-linux-$ARCH.tar.xz && \
ln -s /usr/local/bin/node /usr/local/bin/nodejs && \
npm install -g corepack && \
corepack enable && \
node --version && \
npm --version
# Python (always installed)
RUN apt-get update && apt-get install -y \
python3 python3-pip python3-venv && \
ln -sf /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/* && \
python --version
# uv + uvx (Python package/project manager)
RUN curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/local/bin sh && \
uv --version
# Bun
RUN if [ "$INSTALL_BUN" = "true" ]; then \
apt-get update && apt-get install -y unzip && \
rm -rf /var/lib/apt/lists/* && \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
arm64) ARCH='aarch64';; \
esac; \
curl --proto '=https' --tlsv1.2 -fsSLO "https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/bun-linux-$ARCH.zip" && \
unzip bun-linux-$ARCH.zip -d /tmp/bun && \
mv /tmp/bun/bun-linux-$ARCH/bun /usr/local/bin/bun && \
chmod +x /usr/local/bin/bun && \
rm -rf bun-linux-$ARCH.zip /tmp/bun && \
bun --version ; \
fi
# Rust
RUN if [ "$INSTALL_RUST" = "true" ]; then \
echo 'export RUSTUP_HOME=/usr/local/rustup' >> /etc/profile.d/rust.sh && \
echo 'export CARGO_HOME=/usr/local/cargo' >> /etc/profile.d/rust.sh && \
echo 'export PATH=/usr/local/cargo/bin:$PATH' >> /etc/profile.d/rust.sh && \
. /etc/profile.d/rust.sh && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION && \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME && \
rustc --version && \
cargo --version ; \
fi
# Go
RUN if [ "$INSTALL_GO" = "true" ]; then \
set -eux; \
dpkgArch="$(dpkg --print-architecture)"; ARCH="${dpkgArch##*-}"; \
curl --proto '=https' --tlsv1.2 -fsSLO https://go.dev/dl/go${GO_VERSION}.linux-$ARCH.tar.gz && \
tar -C /usr/local -xzf go${GO_VERSION}.linux-$ARCH.tar.gz && \
rm go${GO_VERSION}.linux-$ARCH.tar.gz && \
echo 'export PATH=/usr/local/go/bin:$PATH' >> /etc/profile.d/go.sh && \
. /etc/profile.d/go.sh && \
go version ; \
fi
# Java (Eclipse Temurin) + Maven + Gradle
RUN if [ "$INSTALL_JAVA" = "true" ]; then \
apt-get update && apt-get install -y wget apt-transport-https gnupg && \
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor -o /usr/share/keyrings/adoptium.gpg && \
echo "deb [signed-by=/usr/share/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb $(. /etc/os-release && echo $VERSION_CODENAME) main" > /etc/apt/sources.list.d/adoptium.list && \
apt-get update && apt-get install -y temurin-${JAVA_VERSION}-jdk maven gradle && \
rm -rf /var/lib/apt/lists/* && \
java --version && \
mvn --version && \
gradle --version ; \
fi
# .NET SDK
RUN if [ "$INSTALL_DOTNET" = "true" ]; then \
apt-get update && apt-get install -y wget libicu-dev && \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch}" in \
amd64) DOTNET_ARCH='x64';; \
arm64) DOTNET_ARCH='arm64';; \
esac; \
wget https://dot.net/v1/dotnet-install.sh -O /tmp/dotnet-install.sh && \
chmod +x /tmp/dotnet-install.sh && \
/tmp/dotnet-install.sh --channel ${DOTNET_VERSION} --install-dir /usr/share/dotnet --architecture $DOTNET_ARCH && \
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet && \
rm /tmp/dotnet-install.sh && \
rm -rf /var/lib/apt/lists/* && \
dotnet --version ; \
fi
# Ruby + Bundler
RUN if [ "$INSTALL_RUBY" = "true" ]; then \
apt-get update && apt-get install -y ruby-full && \
gem install bundler && \
rm -rf /var/lib/apt/lists/* && \
ruby --version && \
bundler --version ; \
fi
# Browsers (Google Chrome + Firefox)
RUN if [ "$INSTALL_BROWSERS" = "true" ]; then \
apt-get update && apt-get install -y \
wget \
libdbus-glib-1-2 && \
# Install Google Chrome from upstream
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb && \
# Install Firefox from Mozilla
wget -q -O firefox.tar.xz "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US" && \
tar -xf firefox.tar.xz -C /opt && \
ln -s /opt/firefox/firefox /usr/local/bin/firefox && \
rm firefox.tar.xz && \
rm -rf /var/lib/apt/lists/* && \
echo "Chrome version:" && google-chrome --version && \
echo "Firefox version:" && firefox --version ; \
fi
# Coding Agent CLIs
RUN if [ "$INSTALL_CODING_AGENTS" = "true" ]; then \
npm install -g \
@anthropic-ai/claude-code \
@openai/codex \
@google/gemini-cli && \
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg 2>/dev/null && \
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
> /etc/apt/sources.list.d/github-cli.list && \
apt-get update && apt-get install -y --no-install-recommends gh && \
rm -rf /var/lib/apt/lists/* && \
echo "Installed coding agent CLIs:" && \
claude --version && \
codex --version && \
gemini --version && \
gh --version ; \
fi
LABEL languages="${LANGUAGES}"