-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile.baremetal
More file actions
293 lines (257 loc) · 8.39 KB
/
dockerfile.baremetal
File metadata and controls
293 lines (257 loc) · 8.39 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# Build stage for remote-dev-box-proxy
FROM golang:1.22-bookworm AS builder
WORKDIR /build
COPY remote-dev-box-proxy/ .
RUN go build -o rdb ./cmd/rdb
FROM ubuntu:noble
ENV DEBIAN_FRONTEND=noninteractive
ENV TIMEZONE=UTC
# Setup timezone
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/timezone
# Install core packages and desktop environment
# --------------------
# BASE (no GUI)
# --------------------
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
openssl \
gnupg \
curl \
wget \
git \
python3 \
python3-venv \
python3-pip \
sudo \
iputils-ping \
locales \
tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# --------------------
# GUI (Xfce + X11 plumbing)
# --------------------
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
xfce4-panel \
xfce4-session \
xfce4-settings \
xfdesktop4 \
xfwm4 \
xfconf \
xfce4-terminal \
thunar \
elementary-xfce-icon-theme \
dmz-cursor-theme \
dbus \
dbus-x11 \
xauth \
x11-xserver-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install KasmVNC (Noble/Ubuntu 24.04)
RUN wget https://github.com/kasmtech/KasmVNC/releases/download/v1.3.3/kasmvncserver_noble_1.3.3_amd64.deb \
&& apt-get update \
&& apt-get install -y ./kasmvncserver_noble_1.3.3_amd64.deb \
&& rm kasmvncserver_noble_1.3.3_amd64.deb \
&& apt-get autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Generate locales
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# Install uv via official repositories
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/usr/local/bin" sh
RUN uv --version
## --------------------
## READY TO GO UTILITIES
## --------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
# --- Editors / Pager / Docs ---
vim \
#nano \
less \
#man-db \
bash-completion \
\
# --- Core inspection / debugging ---
btop \
#htop \
procps \
psmisc \
file \
#strace \
lsof \
\
# --- JSON / text / search ---
jq \
ripgrep \
\
# --- Shell / terminal workflow ---
#tmux \
#zsh \
fzf \
tree \
\
# --- Archives / compression ---
unzip \
zip \
#p7zip-full \
xz-utils \
\
# --- Networking / troubleshooting ---
#openssh-client \
#rsync \
dnsutils \
#netcat-openbsd \
#traceroute \
\
# --- Databases / clients ---
#sqlite3 \
#postgresql-client \
#mysql-client \
#redis-tools \
\
# --- GUI apps ---
#filezilla \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
## --------------------
## READY TO GO APPS
## --------------------
# Install Google Chrome official repositories
# RUN mkdir -p /etc/apt/keyrings \
# && curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor --yes -o /etc/apt/keyrings/google-chrome.gpg \
# && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
# && apt-get update && apt-get install -y --no-install-recommends google-chrome-stable \
# && apt-get autoremove -y \
# && apt-get clean && rm -rf /var/lib/apt/lists/*
## --------------------
# Install Node.js
## --------------------
# RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
# && apt-get install -y --no-install-recommends nodejs \
# && corepack enable \
# && corepack prepare pnpm@latest --activate \
# && npm cache clean --force \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
## --------------------
# Install VS Code
## --------------------
# RUN mkdir -p /etc/apt/keyrings \
# && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc \
# | gpg --dearmor --yes -o /etc/apt/keyrings/microsoft.gpg \
# && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/code stable main" \
# > /etc/apt/sources.list.d/vscode.list \
# && apt-get update \
# && apt-get install -y --no-install-recommends code \
# && apt-get purge -y --auto-remove gpg \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
## --------------------
# Install Gemini
## --------------------
#RUN npm install -g @google/gemini-cli@latest
## --------------------
# Install Codex
## --------------------
#RUN npm install -g @openai/codex@latest
## --------------------
# Install OpenCode
## --------------------
#RUN npm install -g opencode-ai@latest
## --------------------
# Install Copilot
## --------------------
#RUN npm install -g @github/copilot@latest
## --------------------
# Install Claude Code globally
## --------------------
#RUN curl -fsSL https://claude.ai/install.sh | bash \
# && mv /root/.local/share/claude /usr/share/claude \
# && ln -s /usr/share/claude/versions/$(ls /usr/share/claude/versions | head -n 1) /usr/local/bin/claude
## --------------------
# Install Antigravity
## --------------------
#RUN mkdir -p /etc/apt/keyrings \
# && curl -fsSL https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg | gpg --dearmor --yes -o /etc/apt/keyrings/antigravity-repo-key.gpg \
# && echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev/ antigravity-debian main" > /etc/apt/sources.list.d/antigravity.list \
# && apt-get update && apt-get install -y --no-install-recommends antigravity \
# && find /usr/share/antigravity/locales -type f ! -name "en-US.pak" -delete \
# && find /usr/share/antigravity/resources/app/extensions -type d \( -name "markdown-math" -o -name "php-language-features" \) -exec rm -rf {} + \
# && apt-get clean && rm -rf /var/lib/apt/lists/*
## --------------------
# Install Cursor
## --------------------
#RUN mkdir -p /etc/apt/keyrings \
# && curl -fsSL https://downloads.cursor.com/keys/anysphere.asc | gpg --dearmor --yes -o /etc/apt/keyrings/cursor.gpg \
# && echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/cursor.gpg] https://downloads.cursor.com/aptrepo stable main" > /etc/apt/sources.list.d/cursor.list \
# && apt-get update && apt-get install -y --no-install-recommends cursor \
# && apt-get clean && rm -rf /var/lib/apt/lists/*
## --------------------
## Install OpenClaw with Forced Dependency Resolution (Security fix)
## --------------------
# WORKDIR /usr/local/share/openclaw-home
# RUN cat <<'EOF' > package.json
# {
# "dependencies": {
# "openclaw": "latest"
# },
# "pnpm": {
# "overrides": {
# "cmake-js": "^8.0.0",
# "rimraf": "^5.0.5",
# "glob": "^10.4.5",
# "tar": "^7.4.0",
# "glob": "^11.0.0",
# "npmlog": "npm:noop3@^1000.0.0",
# "gauge": "npm:noop3@^1000.0.0",
# "are-we-there-yet": "npm:noop3@^1000.0.0"
# }
# }
# }
# EOF
# RUN pnpm install --prod --unsafe-perm
# RUN echo '#!/bin/bash\nexec node /usr/local/share/openclaw-home/node_modules/openclaw/openclaw.mjs "$@"' > /usr/local/bin/openclaw \
# && chmod +x /usr/local/bin/openclaw
# #RUN chmod -R 755 /usr/local/share/openclaw-home
# WORKDIR /build
# RUN openclaw --version
## --------------------
## Finalize Setup
## --------------------
# Wallpaper setup
COPY assets/background.png /usr/share/backgrounds/xfce/remote-dev-bg.png
RUN printf '%s\n' \
'#!/bin/sh' \
'sleep 5' \
'for monitor in monitor0 monitorVNC-0; do' \
' for workspace in workspace0 workspace1 workspace2 workspace3; do' \
' xfconf-query -c xfce4-desktop -p "/backdrop/screen0/$monitor/$workspace/last-image" -n -t string -s /usr/share/backgrounds/xfce/remote-dev-bg.png' \
' xfconf-query -c xfce4-desktop -p "/backdrop/screen0/$monitor/$workspace/image-style" -n -t int -s 5' \
' done' \
'done' \
> /usr/local/bin/set-wallpaper.sh \
&& chmod +x /usr/local/bin/set-wallpaper.sh
# Autostart wallpaper
RUN mkdir -p /etc/xdg/autostart \
&& printf '%s\n' \
'[Desktop Entry]' \
'Type=Application' \
'Name=Set Wallpaper' \
'Exec=/usr/local/bin/set-wallpaper.sh' \
'Hidden=false' \
'NoDisplay=false' \
'X-GNOME-Autostart-enabled=true' \
> /etc/xdg/autostart/set-wallpaper.desktop
# Copy KasmVNC-aware entrypoint
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Install remote-dev-box-proxy
COPY --from=builder /build/rdb /usr/local/bin/remote-dev-box-proxy
RUN ln -s /usr/local/bin/remote-dev-box-proxy /usr/local/bin/rdb
# KasmVNC normally uses 6901
EXPOSE 6901
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]