mirror of
https://github.com/linuxserver/docker-baseimage-kasmvnc.git
synced 2026-01-09 07:10:59 +08:00
update deps and startup for audio support and logging
This commit is contained in:
parent
aa7e1bc8ba
commit
0175ff490b
12
Dockerfile
12
Dockerfile
@ -133,13 +133,15 @@ ARG KCLIENT_RELEASE
|
||||
RUN \
|
||||
echo "**** install build deps ****" && \
|
||||
apk add --no-cache \
|
||||
alpine-sdk \
|
||||
curl \
|
||||
cmake \
|
||||
g++ \
|
||||
gcc \
|
||||
linux-pam-dev \
|
||||
make \
|
||||
nodejs \
|
||||
npm \
|
||||
pulseaudio-dev \
|
||||
python3
|
||||
|
||||
|
||||
@ -160,7 +162,8 @@ RUN \
|
||||
RUN \
|
||||
echo "**** install node modules ****" && \
|
||||
cd /kclient && \
|
||||
npm install
|
||||
npm install && \
|
||||
rm -f package-lock.json
|
||||
|
||||
# runtime stage
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.17
|
||||
@ -173,6 +176,10 @@ LABEL maintainer="thelamer"
|
||||
|
||||
# env
|
||||
ENV DISPLAY=:1 \
|
||||
PERL5LIB=/usr/local/bin \
|
||||
GOMP_WAIT_POLICY=PASSIVE \
|
||||
GOMP_SPINCOUNT=0 \
|
||||
HOME=/config \
|
||||
NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics,compat32,utility
|
||||
|
||||
# copy over build output
|
||||
@ -238,7 +245,6 @@ RUN \
|
||||
rm -rf \
|
||||
/tmp/*
|
||||
|
||||
|
||||
# add local files
|
||||
COPY /root /
|
||||
|
||||
|
||||
@ -133,13 +133,15 @@ ARG KCLIENT_RELEASE
|
||||
RUN \
|
||||
echo "**** install build deps ****" && \
|
||||
apk add --no-cache \
|
||||
alpine-sdk \
|
||||
curl \
|
||||
cmake \
|
||||
g++ \
|
||||
gcc \
|
||||
linux-pam-dev \
|
||||
make \
|
||||
nodejs \
|
||||
npm \
|
||||
pulseaudio-dev \
|
||||
python3
|
||||
|
||||
|
||||
@ -160,7 +162,8 @@ RUN \
|
||||
RUN \
|
||||
echo "**** install node modules ****" && \
|
||||
cd /kclient && \
|
||||
npm install
|
||||
npm install && \
|
||||
rm -f package-lock.json
|
||||
|
||||
# runtime stage
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.17
|
||||
@ -173,6 +176,10 @@ LABEL maintainer="thelamer"
|
||||
|
||||
# env
|
||||
ENV DISPLAY=:1 \
|
||||
PERL5LIB=/usr/local/bin \
|
||||
GOMP_WAIT_POLICY=PASSIVE \
|
||||
GOMP_SPINCOUNT=0 \
|
||||
HOME=/config \
|
||||
NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics,compat32,utility
|
||||
|
||||
# copy over build output
|
||||
@ -237,7 +244,6 @@ RUN \
|
||||
rm -rf \
|
||||
/tmp/*
|
||||
|
||||
|
||||
# add local files
|
||||
COPY /root /
|
||||
|
||||
|
||||
2
root/defaults/startwm.sh
Executable file
2
root/defaults/startwm.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
/usr/bin/openbox-session
|
||||
@ -1,4 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
HOME=/config
|
||||
/startpulse.sh &
|
||||
/usr/bin/openbox-session #> /dev/null 2>&1
|
||||
@ -1,15 +1,6 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# default file copies first run
|
||||
if [ ! -d /config/.vnc ]; then
|
||||
mkdir -p /config/.vnc
|
||||
if [ -f "/defaults/startwm.sh" ]; then
|
||||
cp /defaults/startwm.sh /config/.vnc/xstartup
|
||||
else
|
||||
cp /defaults/xstartup /config/.vnc/xstartup
|
||||
fi
|
||||
touch /config/.vnc/.de-was-selected
|
||||
fi
|
||||
if [ ! -d /config/.config/openbox/autostart ]; then
|
||||
mkdir -p /config/.config/openbox
|
||||
cp /defaults/autostart /config/.config/openbox/autostart
|
||||
@ -20,19 +11,3 @@ if [[ ! -f /config/.config/openbox/menu.xml ]]; then
|
||||
cp /defaults/menu.xml /config/.config/openbox/menu.xml && \
|
||||
chown -R abc:abc /config/.config
|
||||
fi
|
||||
|
||||
# password
|
||||
if [ ! -f "/config/.kasmpasswd" ]; then
|
||||
if [ -z ${VNC_PW+x} ]; then
|
||||
VNC_PW="abc"
|
||||
fi
|
||||
VNC_PW_HASH=$(python3 -c "import crypt; print(crypt.crypt('${VNC_PW}', '\$5\$kasm\$'));")
|
||||
echo "abc:${VNC_PW_HASH}:ow" > /config/.kasmpasswd
|
||||
chmod 600 /config/.kasmpasswd
|
||||
fi
|
||||
|
||||
# permissions
|
||||
PERM=$(stat -c '%U' /config/.vnc)
|
||||
if [ "${PERM}" != "abc" ]; then
|
||||
chown -R abc:abc /config
|
||||
fi
|
||||
|
||||
4
root/etc/s6-overlay/s6-rc.d/svc-de/run
Executable file
4
root/etc/s6-overlay/s6-rc.d/svc-de/run
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
s6-setuidgid abc \
|
||||
/bin/bash /defaults/startwm.sh
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-de/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-de/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
@ -1,15 +1,15 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
HOME="/config"
|
||||
|
||||
PERL5LIB=/usr/local/bin/ \
|
||||
OMP_WAIT_POLICY=PASSIVE \
|
||||
GOMP_SPINCOUNT=0 \
|
||||
s6-setuidgid abc \
|
||||
vncserver \
|
||||
$DISPLAY \
|
||||
/usr/local/bin/Xvnc $DISPLAY \
|
||||
-disableBasicAuth \
|
||||
-SecurityTypes None \
|
||||
-AlwaysShared
|
||||
|
||||
sleep infinity
|
||||
-AlwaysShared \
|
||||
-http-header Cross-Origin-Embedder-Policy=require-corp \
|
||||
-http-header Cross-Origin-Opener-Policy=same-origin \
|
||||
-geometry 1024x768 \
|
||||
-sslOnly 0 \
|
||||
-RectThreads 0 \
|
||||
-websocketPort 6901 \
|
||||
-interface 0.0.0.0 \
|
||||
-Log *:stdout:10
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# NodeJS wrapper
|
||||
cd /kclient
|
||||
s6-setuidgid abc \
|
||||
node index.js
|
||||
|
||||
7
root/etc/s6-overlay/s6-rc.d/svc-pulseaudio/run
Executable file
7
root/etc/s6-overlay/s6-rc.d/svc-pulseaudio/run
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
s6-setuidgid abc \
|
||||
/usr/bin/pulseaudio \
|
||||
--log-level=0 \
|
||||
--log-target=stderr \
|
||||
--exit-idle-time=-1 > /dev/null 2>&1
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-pulseaudio/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-pulseaudio/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
0
root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-de
Normal file
0
root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-de
Normal file
@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
while :
|
||||
do
|
||||
if [[ ! $(/usr/bin/pulseaudio --check) ]]; then
|
||||
/usr/bin/pulseaudio --start
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user