-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile
More file actions
298 lines (289 loc) · 8.31 KB
/
Dockerfile
File metadata and controls
298 lines (289 loc) · 8.31 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
# syntax=docker/dockerfile:1
FROM lscr.io/linuxserver/xvfb:debiantrixie AS xvfb
FROM ghcr.io/linuxserver/baseimage-alpine:3.22 AS frontend
RUN \
echo "**** install build packages ****" && \
apk add \
cmake \
git \
nodejs \
npm
RUN \
echo "**** ingest code ****" && \
git clone \
https://github.com/selkies-project/selkies.git \
/src && \
cd /src && \
git checkout -f f114a2332672852f7845b3543b9390edfc033787
RUN \
echo "**** build shared core library ****" && \
cd /src/addons/gst-web-core && \
npm install && \
npm run build && \
echo "**** build multiple dashboards ****" && \
DASHBOARDS="selkies-dashboard selkies-dashboard-zinc selkies-dashboard-wish" && \
mkdir /buildout && \
for DASH in $DASHBOARDS; do \
cd /src/addons/$DASH && \
cp ../gst-web-core/dist/selkies-core.js src/ && \
npm install && \
npm run build && \
mkdir -p dist/src dist/nginx && \
cp ../gst-web-core/dist/selkies-core.js dist/src/ && \
cp ../universal-touch-gamepad/universalTouchGamepad.js dist/src/ && \
cp ../gst-web-core/nginx/* dist/nginx/ && \
cp -r ../gst-web-core/dist/jsdb dist/ && \
mkdir -p /buildout/$DASH && \
cp -ar dist/* /buildout/$DASH/; \
done
# Runtime stage
FROM ghcr.io/linuxserver/baseimage-debian:trixie
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
# env
ENV DISPLAY=:1 \
PERL5LIB=/usr/local/bin \
HOME=/config \
START_DOCKER=true \
PULSE_RUNTIME_PATH=/defaults \
SELKIES_INTERPOSER=/usr/lib/selkies_joystick_interposer.so \
NVIDIA_DRIVER_CAPABILITIES=all \
DISABLE_ZINK=false \
DISABLE_DRI3=false \
TITLE=Selkies
RUN \
echo "**** dev deps ****" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
python3-dev && \
echo "**** enable locales ****" && \
sed -i \
'/locale/d' \
/etc/dpkg/dpkg.cfg.d/docker && \
echo "**** install deps ****" && \
curl -fsSL https://download.docker.com/linux/debian/gpg | tee /usr/share/keyrings/docker.asc >/dev/null && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker.asc] https://download.docker.com/linux/debian trixie stable" > /etc/apt/sources.list.d/docker.list && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
breeze-cursor-theme \
ca-certificates \
cmake \
console-data \
containerd.io \
dbus-x11 \
docker-buildx-plugin \
docker-ce \
docker-ce-cli \
docker-compose-plugin \
dunst \
file \
firmware-linux-nonfree \
firmware-misc-nonfree \
fonts-noto-cjk \
fonts-noto-color-emoji \
fonts-noto-core \
foot \
fuse-overlayfs \
g++ \
gcc \
git \
intel-media-va-driver \
kbd \
labwc \
libatk1.0-0 \
libatk-bridge2.0-0 \
libev4 \
libfontenc1 \
libfreetype6 \
libgbm1 \
libgcrypt20 \
libgirepository-1.0-1 \
libgl1-mesa-dri \
libglu1-mesa \
libgnutls30 \
libgtk-3.0 \
libnginx-mod-http-fancyindex \
libnotify-bin \
libnss3 \
libnvidia-egl-wayland1 \
libopus0 \
libp11-kit0 \
libpam0g \
libtasn1-6 \
libvulkan1 \
libwayland-client0 \
libwayland-cursor0 \
libwayland-egl1 \
libwayland-server0 \
libx11-6 \
libxau6 \
libxcb1 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcursor1 \
libxdmcp6 \
libxext6 \
libxfconf-0-3 \
libxfixes3 \
libxfont2 \
libxinerama1 \
libxkbcommon-dev \
libxkbcommon-x11-0 \
libxshmfence1 \
libxtst6 \
locales-all \
make \
mesa-libgallium \
mesa-va-drivers \
mesa-vulkan-drivers \
nginx \
openbox \
openssh-client \
openssl \
pciutils \
procps \
pulseaudio \
pulseaudio-utils \
python3 \
python3-venv \
ssl-cert \
stterm \
sudo \
tar \
util-linux \
vulkan-tools \
wl-clipboard \
wlr-randr \
wtype \
x11-apps \
x11-common \
x11-utils \
x11-xkb-utils \
x11-xserver-utils \
xauth \
xclip \
xcvt \
xdg-utils \
xdotool \
xfconf \
xfonts-base \
xkb-data \
xsel \
xserver-common \
xserver-xorg-core \
xserver-xorg-video-amdgpu \
xserver-xorg-video-ati \
xserver-xorg-video-intel \
xserver-xorg-video-nouveau \
xserver-xorg-video-qxl \
xsettingsd \
xterm \
xutils \
xvfb \
zlib1g && \
echo "**** install selkies ****" && \
SELKIES_RELEASE=$(curl -sX GET "https://api.github.com/repos/selkies-project/selkies/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
curl -o \
/tmp/selkies.tar.gz -L \
"https://github.com/selkies-project/selkies/archive/f114a2332672852f7845b3543b9390edfc033787.tar.gz" && \
cd /tmp && \
tar xf selkies.tar.gz && \
cd selkies-* && \
sed -i '/"av>/d' pyproject.toml && \
sed -i '/cryptography/d' pyproject.toml && \
python3 \
-m venv \
--system-site-packages \
/lsiopy && \
pip install . && \
pip install setuptools && \
echo "**** install selkies interposer ****" && \
cd addons/js-interposer && \
gcc -shared -fPIC -ldl \
-o selkies_joystick_interposer.so \
joystick_interposer.c && \
mv \
selkies_joystick_interposer.so \
/usr/lib/selkies_joystick_interposer.so && \
echo "**** install selkies fake udev ****" && \
cd ../fake-udev && \
make && \
mkdir /opt/lib && \
mv \
libudev.so.1.0.0-fake \
/opt/lib/ && \
echo "**** add icon ****" && \
mkdir -p \
/usr/share/selkies/www && \
curl -o \
/usr/share/selkies/www/icon.png \
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/selkies-logo.png && \
curl -o \
/usr/share/selkies/www/favicon.ico \
https://raw.githubusercontent.com/linuxserver/docker-templates/refs/heads/master/linuxserver.io/img/selkies-icon.ico && \
echo "**** openbox tweaks ****" && \
sed -i \
-e 's/NLIMC/NLMC/g' \
-e '/debian-menu/d' \
-e 's|</applications>| <application class="*"><maximized>yes</maximized></application>\n</applications>|' \
-e 's|</keyboard>| <keybind key="C-S-d"><action name="ToggleDecorations"/></keybind>\n</keyboard>|' \
-e 's|<number>4</number>|<number>1</number>|' \
/etc/xdg/openbox/rc.xml && \
sed -i \
's/--startup/--replace --startup/g' \
/usr/bin/openbox-session && \
echo "**** user perms ****" && \
sed -e 's/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \
-i /etc/sudoers && \
echo "abc:abc" | chpasswd && \
usermod -s /bin/bash abc && \
usermod -aG sudo abc && \
echo "**** proot-apps ****" && \
mkdir /proot-apps/ && \
PAPPS_RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/proot-apps/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
curl -L https://github.com/linuxserver/proot-apps/releases/download/${PAPPS_RELEASE}/proot-apps-x86_64.tar.gz \
| tar -xzf - -C /proot-apps/ && \
echo "${PAPPS_RELEASE}" > /proot-apps/pversion && \
echo "**** dind support ****" && \
useradd -U dockremap && \
usermod -G dockremap dockremap && \
echo 'dockremap:165536:65536' >> /etc/subuid && \
echo 'dockremap:165536:65536' >> /etc/subgid && \
curl -o \
/usr/local/bin/dind -L \
https://raw.githubusercontent.com/moby/moby/master/hack/dind && \
chmod +x /usr/local/bin/dind && \
echo 'hosts: files dns' > /etc/nsswitch.conf && \
usermod -aG docker abc && \
echo "**** locales ****" && \
for LOCALE in $(curl -sL https://raw.githubusercontent.com/thelamer/lang-stash/master/langs); do \
localedef -i $LOCALE -f UTF-8 $LOCALE.UTF-8; \
done && \
echo "**** theme ****" && \
curl -s https://raw.githubusercontent.com/thelamer/lang-stash/master/theme.tar.gz \
| tar xzvf - -C /usr/share/themes/Clearlooks/openbox-3/ && \
echo "**** cleanup ****" && \
apt-get purge -y --autoremove \
python3-dev && \
apt-get autoclean && \
rm -rf \
/config/.cache \
/config/.npm \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*
# add local files
COPY /root /
COPY --from=frontend /buildout /usr/share/selkies
COPY --from=xvfb / /
# ports and volumes
EXPOSE 3000 3001
VOLUME /config