-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
413 lines (376 loc) · 12 KB
/
Dockerfile
File metadata and controls
413 lines (376 loc) · 12 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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# Steam Headless (Arch Linux)
# (WIP) An Arch variant of the steam-headless image
# It is curerently my intent to switch to arch as the main
# image base once SteamOS 3 is released (pending review)
#
FROM archlinux:latest
# orignal creater.
LABEL maintainer="Josh.5 <jsunnex@gmail.com>"
# current fork mainainer.
LABEL maintainer="Dean <dean@rickles.co.uk>"
# Update package repos
RUN \
echo "**** Update package manager ****" \
&& sed -i 's/^NoProgressBar/#NoProgressBar/g' /etc/pacman.conf \
&& echo -e "[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& \
echo
# Update locale
# [02/05/2022] DeanRickles: Changed from US to GB scrapped while testing other things.
RUN \
echo "**** Configure locals ****" \
&& echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \
&& locale-gen \
&& \
echo
ENV \
LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# Re-install certificates
#[07/05/2022] DeanRickles: This package contains the set of CA certificates chosen by the Mozilla Foundation for use with the Internet PKI.
RUN \
echo "**** Install certificates ****" \
&& pacman -Syu --noconfirm --needed \
ca-certificates \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install core packages
# [02/05/2022] DeanRickles: Is python-numpy really needed?
# [07/05/2022] DeanRickles: python is used within some one the bash scriptd.
# [07/05/2022] DeanRickles: added vulkan-tools for troubleshooting. Look to add a github check that vulkaninfo passes without any errors.
## breakdown of utility packages. ##
# unsure if needed preappended #?
#**** Install tools ****
# bash = The GNU Bourne Again shell.
# bash-completion = Programmable completion for the bash shell.
# curl = An URL retrieval utility and library.
# git = the fast distributed version control system.
# less = A terminal based program for viewing text files.
# man-db = A utility for reading man pages.
# nano = Pico editor clone with enhancements.
# net-tools = Configuration tools for Linux networking.
# pkg-config = Package compiler and linker metadata toolkit?
# rsync = A fast and versatile file copying tool for remote and local files.
# screen = Full-screen window manager that multiplexes a physical terminal.
# sudo = Give certain users the ability to run some commands as root.
# unzip = For extracting and viewing files in .zip archives.
# vim = Vi Improved, a highly configurable, improved version of the vi text editor.
# wget = Network utility to retrieve files from the Web.
# xz = Library and command line tools for XZ and LZMA compressed files.
# vulkan-tools =
#**** Install python ****
# python = Next generation of the python high-level scripting language
#?# python-numpy = Scientific tools for Python
# python-pip = The PyPA recommended tool for installing Python packages
#?# python-setuptools = Easily download, build, install, upgrade, and uninstall Python packages
RUN \
echo "**** Install tools ****" \
&& pacman -Syu --noconfirm --needed \
bash \
bash-completion \
curl \
git \
less \
man-db \
nano \
net-tools \
pkg-config \
rsync \
screen \
sudo \
unzip \
vim \
wget \
xz \
vulkan-tools \
&& \
echo "**** Install python ****" \
&& pacman -Syu --noconfirm --needed \
python \
python-numpy \
python-pip \
python-setuptools \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install supervisor
# [07/05/2022] DeanRickles:
# supervisor = A system for controlling process state under UNIX.
RUN \
echo "**** Install supervisor ****" \
&& pacman -Syu --noconfirm --needed \
supervisor \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# XFS requirements
RUN \
echo "**** Install XFS requirements ****" \
&& pacman -Syu --noconfirm --needed \
xfsdump \
xfsprogs \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# [07/05/2022] DeanRickles: added amdvlk and vulken-intel to sort out vulken errors.
# [07/05/2022] DeanRickles: added vulkan-radeon lib32-vulkan-radeon mean't to add to last push.
# Install mesa requirements
RUN \
echo "**** Install mesa and vulkan requirements ****" \
&& pacman -Syu --noconfirm --needed \
glu \
libva-mesa-driver \
mesa-utils \
mesa-vdpau \
opencl-mesa \
pciutils \
vulkan-mesa-layers \
vulkan-intel \
vulkan-radeon \
lib32-vulkan-radeon \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install X Server requirements
# TODO: Remove doubles
# TODO: Things that are not required
RUN \
echo "**** Install X Server requirements ****" \
&& pacman -Syu --noconfirm --needed \
avahi \
dbus \
lib32-fontconfig \
ttf-liberation \
x11vnc \
xorg \
xorg-apps \
xorg-font-util \
xorg-fonts-misc \
xorg-fonts-type1 \
xorg-server \
xorg-server-xephyr \
xorg-server-xvfb \
xorg-xauth \
xorg-xbacklight \
xorg-xhost \
xorg-xinit \
xorg-xinput \
xorg-xkill \
xorg-xprop \
xorg-xrandr \
xorg-xsetroot \
xorg-xwininfo \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install audio requirements
RUN \
echo "**** Install X Server requirements ****" \
&& pacman -Syu --noconfirm --needed \
pulseaudio \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install openssh server
RUN \
echo "**** Install openssh server ****" \
&& pacman -Syu --noconfirm --needed \
openssh \
&& echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install noVNC
# [02/05/2022] DeanRickles: any reason we're version controlling NOVNC?
# [02/05/2022] DeanRickles: Assuming there is a credentials file
ARG NOVNC_VERSION=1.2.0
RUN \
echo "**** Fetch noVNC ****" \
&& cd /tmp \
&& wget -O /tmp/novnc.tar.gz https://github.com/novnc/noVNC/archive/v${NOVNC_VERSION}.tar.gz \
&& \
echo "**** Extract noVNC ****" \
&& cd /tmp \
&& tar -xvf /tmp/novnc.tar.gz \
&& \
echo "**** Configure noVNC ****" \
&& cd /tmp/noVNC-${NOVNC_VERSION} \
&& sed -i 's/credentials: { password: password } });/credentials: { password: password },\n wsProtocols: ["'"binary"'"] });/g' app/ui.js \
&& mkdir -p /opt \
&& rm -rf /opt/noVNC \
&& cd /opt \
&& mv -f /tmp/noVNC-${NOVNC_VERSION} /opt/noVNC \
&& cd /opt/noVNC \
&& ln -s vnc.html index.html \
&& chmod -R 755 /opt/noVNC \
&& \
echo "**** Modify noVNC title ****" \
&& sed -i '/ document.title =/c\ document.title = "Steam Headless - noVNC";' \
/opt/noVNC/app/ui.js \
&& \
echo "**** Section cleanup ****" \
&& rm -rf \
/tmp/noVNC* \
/tmp/novnc.tar.gz
# Install Websockify
# [02/05/2022] DeanRickles: Look into Websockift and how it works.
ARG WEBSOCKETIFY_VERSION=0.10.0
RUN \
echo "**** Fetch Websockify ****" \
&& cd /tmp \
&& wget -O /tmp/websockify.tar.gz https://github.com/novnc/websockify/archive/v${WEBSOCKETIFY_VERSION}.tar.gz \
&& \
echo "**** Extract Websockify ****" \
&& cd /tmp \
&& tar -xvf /tmp/websockify.tar.gz \
&& \
echo "**** Install Websockify to main ****" \
&& cd /tmp/websockify-${WEBSOCKETIFY_VERSION} \
&& python3 ./setup.py install \
&& \
echo "**** Install Websockify to noVNC path ****" \
&& cd /tmp \
&& mv -v /tmp/websockify-${WEBSOCKETIFY_VERSION} /opt/noVNC/utils/websockify \
&& \
echo "**** Section cleanup ****" \
&& rm -rf \
/tmp/websockify-* \
/tmp/websockify.tar.gz
# Install firefox
# TODO: Move under de
# [02/05/2022] DeanRickles: why does it need firefox?
RUN \
echo "**** Install firefox ****" \
&& pacman -Syu --noconfirm --needed \
firefox \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# [02/05/2022] DeanRickles: Assuming commented out while testing?
# [04/05/2022] DeanRickles: Enabled Steam install
# Install Steam
RUN \
echo "**** Install steam ****" \
&& pacman -Syu --noconfirm --needed \
lib32-vulkan-icd-loader \
steam \
vulkan-icd-loader \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Install desktop environment
RUN \
echo "**** Install desktop environment ****" \
&& pacman -Syu --noconfirm --needed \
gedit \
xfce4 \
xfce4-terminal \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Add support for flatpaks
RUN \
echo "**** Install flatpak support ****" \
&& pacman -Syu --noconfirm --needed \
flatpak \
xdg-desktop-portal-gtk \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# TODO Append to tools
RUN \
echo "**** Install flatpak support ****" \
&& pacman -Syu --noconfirm --needed \
patch \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# [04/05/2022] DeanRickles: Need the locale text files otherwise text input doesn't work with steam on through onVNC.
# [04/05/2022] DeanRickles: Need to look into how to enable without re-install.
RUN \
echo "**** including X11 language packs ****" \
&& sed -i 's/NoExtract = usr\/share\/locale\/\* usr\/share\/X11\/locale\/\* usr\/share\/i18n\/\*/#NoExtract = usr\/share\/locale\/\* usr\/share\/X11\/locale\/\* usr\/share\/i18n\/\*/g' /etc/pacman.conf \
&& pacman -Qqn | pacman -S --noconfirm - \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& \
echo
# Configure default user and set env
ENV \
USER="default" \
USER_PASSWORD="password" \
USER_HOME="/home/default" \
TZ="Pacific/Auckland" \
USER_LOCALES="en_US.UTF-8 UTF-8"
RUN \
echo "**** Configure default user '${USER}' ****" \
&& mkdir -p \
${USER_HOME} \
&& useradd -d ${USER_HOME} -s /bin/bash ${USER} \
&& chown -R ${USER} \
${USER_HOME} \
&& echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Add FS overlay
COPY overlay /
# Set display environment variables
ENV \
DISPLAY_CDEPTH="24" \
DISPLAY_DPI="96" \
DISPLAY_REFRESH="60" \
DISPLAY_SIZEH="900" \
DISPLAY_SIZEW="1600" \
DISPLAY_VIDEO_PORT="DFP" \
DISPLAY=":55" \
NVIDIA_DRIVER_CAPABILITIES="all" \
NVIDIA_VISIBLE_DEVICES="all"
#[03/05/2022] DeanRickles added NO_AT_BRIDGE=1
# Set container configuration environment variables
ENV \
MODE="primary" \
ENABLE_VNC_AUDIO="true" \
NO_AT_BRIDGE=1
# Configure required ports
ENV \
PORT_SSH="2222" \
PORT_VNC="5900" \
PORT_AUDIO_STREAM="5901" \
PORT_NOVNC_WEB="8083" \
PORT_AUDIO_WEBSOCKET="32123"
# Expose the required ports
EXPOSE 2222
EXPOSE 5900
EXPOSE 5901
EXPOSE 8083
EXPOSE 32123
# Set entrypoint
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]