-
-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathDockerfile.arch
510 lines (480 loc) · 15 KB
/
Dockerfile.arch
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
# 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
LABEL maintainer="Josh.5 <[email protected]>"
# 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
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
RUN \
echo "**** Install certificates ****" \
&& pacman -Syu --noconfirm --needed \
ca-certificates \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install core packages
RUN \
echo "**** Install tools ****" \
&& pacman -Syu --noconfirm --needed \
base-devel \
bash \
bash-completion \
curl \
docbook-xml \
docbook-xsl \
fakeroot \
p7zip \
patch \
git \
jq \
less \
locate \
man-db \
nano \
net-tools \
pciutils \
pkg-config \
procps \
psmisc \
psutils \
rsync \
screen \
sudo \
unzip \
vim \
wget \
xmlstarlet \
xz \
&& \
echo "**** Install python ****" \
&& pacman -Syu --noconfirm --needed \
python \
python-numpy \
python-pip \
python-setuptools \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Configure default user and set user env
ENV \
PUID=99 \
PGID=100 \
UMASK=000 \
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 \
&& \
echo
# Install yay
RUN \
echo "**** Install Yay ****" \
&& pacman -Sy \
&& su - default -c 'git clone https://aur.archlinux.org/yay.git /tmp/yay && cd /tmp/yay && makepkg --noconfirm --syncdeps --install' \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /home/default/.cache/yay \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& rm -rf /tmp/yay* \
&& \
echo
# Install supervisor
RUN \
echo "**** Install supervisor ****" \
&& pacman -Syu --noconfirm --needed \
supervisor \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install mscorefonts
RUN \
echo "**** Install ms fonts ****" \
&& su - default -c "yay -Syu --noconfirm --needed ttf-msfonts" \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /home/default/.cache/yay \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& rm -rf /tmp/yay* \
&& \
echo
# Install X Server requirements
ENV \
XORG_SOCKET_DIR="/tmp/.X11-unix" \
XDG_RUNTIME_DIR="/tmp/.X11-unix/run" \
XDG_SESSION_TYPE="x11" \
FORCE_X11_DUMMY_CONFIG="false"
RUN \
echo "**** Install X Server requirements ****" \
&& pacman -Syu --noconfirm --needed \
avahi \
dbus \
lib32-fontconfig \
fuse2 \
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 \
xf86-input-evdev \
xterm \
gamescope \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install audio requirements
ENV \
PULSE_SOCKET_DIR="/tmp/pulse" \
PULSE_SERVER="unix:/tmp/pulse/pulse-socket"
RUN \
echo "**** Install X Server requirements ****" \
&& pacman -Syu --noconfirm --needed \
alsa-utils \
pavucontrol \
pulseaudio \
pulseaudio-alsa \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install desktop environment
# TODO: Install equivelent of 'msttcorefonts' and 'fonts-vlgothic'
RUN \
echo "**** Install desktop environment ****" \
&& pacman -Syu --noconfirm --needed \
gedit \
xfce4 \
xfce4-goodies \
xfce4-terminal \
ttf-liberation \
xdg-user-dirs \
xdg-utils \
imagemagick \
&& \
echo "**** Install WoL Manager requirements ****" \
&& pacman -Syu --noconfirm --needed \
tcpdump \
xprintidle \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Add support for flatpaks
ENV \
XDG_DATA_DIRS="/home/default/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/"
RUN \
echo "**** Install flatpak support ****" \
&& pacman -Syu --noconfirm --needed \
flatpak \
xdg-desktop-portal-gtk \
gnome-software \
&& \
echo "**** Configure flatpak ****" \
&& chmod u-s /usr/bin/bwrap \
&& flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo \
&& su - default -c "flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo" \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# TODO: Deprecate neko
# Install Neko server
COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko
COPY --from=m1k1o/neko:base /var/www /var/www
# Install Web Frontend
ARG FRONTEND_VERSION=a8eb92f
RUN \
echo "**** Fetch Web Frontend ****" \
&& mkdir -p /opt \
&& cd /opt \
&& rm -rf /opt/frontend \
&& git clone https://github.com/Steam-Headless/frontend.git --branch master /opt/frontend \
&& cd /opt/frontend \
&& git checkout ${FRONTEND_VERSION} 2> /dev/null \
&& git submodule init \
&& git submodule update --depth 1 --recursive \
&& rm -rf /opt/frontend/.git \
&& \
echo "**** Configure Web Frontend ****" \
&& echo '<!DOCTYPE html>' > /opt/frontend/index.html \
&& echo '<html><head><meta http-equiv="refresh" content="0;url=./web/"></head><body><p>If you are not redirected, <a href="./web/">click here</a>.</p></body></html>' >> /opt/frontend/index.html \
&& chmod -R 755 /opt/frontend \
&& convert /opt/frontend/web/images/icons/novnc-ios-180.png -resize "128x128" /tmp/steam-headless.png \
&& xdg-icon-resource install --novendor --size 128 /tmp/steam-headless.png \
&& \
echo "**** Section cleanup ****" \
&& rm -f /tmp/steam-headless.png
# Install Websockify
ARG WEBSOCKETIFY_VERSION=0.11.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 \
&& mkdir -p /opt/noVNC/utils \
&& mv -v /tmp/websockify-${WEBSOCKETIFY_VERSION} /opt/noVNC/utils/websockify \
&& \
echo "**** Section cleanup ****" \
&& rm -rf \
/tmp/websockify-* \
/tmp/websockify.tar.gz \
&& \
echo
# Setup browser audio streaming deps
RUN \
echo "**** Install audio streaming deps ****" \
&& pacman -Syu --noconfirm --needed \
bzip2 \
gst-libav \
gst-plugins-bad \
gst-plugins-base \
gst-plugins-good \
gst-plugins-ugly \
&& \
#echo "**** Fetch ucspi-tcp ****" \
# && mkdir -p /tmp/ucspi-tcp-0.88 \
# && cd /tmp \
# #&& wget -O /tmp/ucspi-tcp.tar.gz https://github.com/trafficgate/ucspi-tcp/archive/refs/heads/master.tar.gz \
# && wget -O /tmp/ucspi-tcp.tar.gz http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz \
# && cd /tmp/ucspi-tcp-0.88 \
# && tar -xvf /tmp/ucspi-tcp.tar.gz --strip-components=1 \
#&& \
#echo "**** Build and install ucspi-tcp ****" \
# && wget -O /tmp/ucspi-tcp-0.88/ucspi-tcp-0.88.errno.patch https://git.alpinelinux.org/aports/plain/testing/ucspi-tcp/ucspi-tcp-0.88.errno.patch \
# && wget -O /tmp/ucspi-tcp-0.88/ucspi-tcp-0.88.a_record.patch https://git.alpinelinux.org/aports/plain/testing/ucspi-tcp/ucspi-tcp-0.88.a_record.patch \
# && patch -p1 --input=ucspi-tcp-0.88.errno.patch \
# && patch -p1 --input=ucspi-tcp-0.88.a_record.patch \
# && sed -i 's|^/usr/local|/usr|' /tmp/ucspi-tcp-0.88/conf-home \
# && make \
# && for f in tcpserver tcprules tcprulescheck argv0 recordio tcpclient *\@ tcpcat mconnect mconnect-io addcr delcr fixcrio rblsmtpd; do \
# cp $f /usr/bin/$f; \
# done \
#&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Setup video streaming deps
RUN \
echo "**** Install video streaming deps ****" \
&& pacman -Syu --noconfirm --needed \
libva \
libva-mesa-driver \
libva-intel-driver \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install tools for monitoring hardware
RUN \
echo "**** Install audio streaming deps ****" \
&& pacman -Syu --noconfirm --needed \
#cpu-x \
htop \
libva-utils \
vdpauinfo \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install Sunshine
RUN \
echo "**** Install stable sunshine ****" \
&& su - default -c "yay -Syu --noconfirm --needed miniupnpc sunshine-bin" \
&& setcap cap_sys_admin+p $(readlink -f $(which sunshine)) \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /home/default/.cache/yay \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& rm -rf /tmp/yay* \
&& \
echo
# Install Firefox
RUN \
echo "**** Install Firefox ****" \
&& pacman -Syu --noconfirm --needed \
firefox \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Install Steam
RUN \
echo "**** Install Steam ****" \
&& pacman -Syu --noconfirm --needed \
steam \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& \
echo
# Various other tools
ARG DUMB_INIT_VERSION=1.2.5
ARG DUMB_UDEV_VERSION=64d1427
RUN \
echo "**** Install dumb-init ****" \
&& wget --no-check-certificate --no-cookies --quiet \
-O /usr/bin/dumb-init \
https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_x86_64 \
&& chmod +x /usr/bin/dumb-init \
&& \
echo "**** Install dumb-udev ****" \
&& python3 -m pip install \
--break-system-packages \
--pre \
--upgrade \
--no-cache-dir \
git+https://github.com/Steam-Headless/dumb-udev.git@${DUMB_UDEV_VERSION} \
&& \
echo
# Install Protonup replacement
RUN \
echo "**** Install PorotonUP ****" \
&& su - default -c "yay -Sy --noconfirm --needed --overwrite \"/usr/bin/normalizer\" protonup-qt" \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /home/default/.cache/yay \
&& rm -fr /var/lib/pacman/sync/* \
&& rm -fr /var/cache/pacman/pkg/* \
&& rm -rf /tmp/yay* \
&& \
echo
# Add FS overlay
COPY overlay /
# Tweaks as flatpak issue isn't sorted
RUN \
echo "**** Tweaks for Arch ****" \
&& sed -i d /usr/bin/install_firefox.sh \
&& sed -i d /usr/bin/install_protonup.sh \
&& sed -i d /templates/home_directory_template/.local/share/xfce4/helpers/custom-WebBrowser.desktop \
&& \
echo
# Set display environment variables
ENV \
DISPLAY_CDEPTH="24" \
DISPLAY_REFRESH="120" \
DISPLAY_SIZEH="900" \
DISPLAY_SIZEW="1600" \
DISPLAY_VIDEO_PORT="DFP" \
DISPLAY=":55"
ENV \
NVIDIA_DRIVER_CAPABILITIES="all" \
NVIDIA_VISIBLE_DEVICES="all"
# Set container configuration environment variables
# APPIMAGE_EXTRACT_AND_RUN="0"
ENV \
MODE="primary" \
WEB_UI_MODE="vnc" \
ENABLE_VNC_AUDIO="true" \
NEKO_PASSWORD=neko \
NEKO_PASSWORD_ADMIN=admin \
ENABLE_STEAM="true" \
STEAM_ARGS="-silent" \
ENABLE_SUNSHINE="true" \
ENABLE_EVDEV_INPUTS="true" \
ENABLE_WOL_POWER_MANAGER="false"
# Configure required ports
ENV \
PORT_NOVNC_WEB="8083" \
NEKO_NAT1TO1=""
# Expose the required ports
EXPOSE 8083
# Set entrypoint
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]