update deps and startup for audio support and logging

This commit is contained in:
thelamer 2023-02-12 16:25:54 -08:00
parent aa7e1bc8ba
commit 0175ff490b
18 changed files with 44 additions and 53 deletions

View File

@ -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 /

View File

@ -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
View File

@ -0,0 +1,2 @@
#!/usr/bin/with-contenv bash
/usr/bin/openbox-session

View File

@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bash
HOME=/config
/startpulse.sh &
/usr/bin/openbox-session #> /dev/null 2>&1

View File

@ -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

View File

@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bash
s6-setuidgid abc \
/bin/bash /defaults/startwm.sh

View File

@ -0,0 +1 @@
longrun

View File

@ -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

View File

@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bash
# NodeJS wrapper
cd /kclient
s6-setuidgid abc \
node index.js

View 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

View File

@ -0,0 +1 @@
longrun

View File

@ -1,8 +0,0 @@
#!/bin/bash
while :
do
if [[ ! $(/usr/bin/pulseaudio --check) ]]; then
/usr/bin/pulseaudio --start
fi
sleep 10
done