mirror of
https://git.myvelabs.com/novnc/archlinux.git
synced 2025-12-17 21:36:20 +00:00
109 lines
No EOL
2.4 KiB
Bash
109 lines
No EOL
2.4 KiB
Bash
## Dockerfile
|
|
cat >Dockerfile <<- 'Dockerfile'
|
|
# syntax = docker/dockerfile:1.2
|
|
FROM myvnc/base
|
|
USER root
|
|
|
|
# X session environment variable
|
|
ENV STARTXBIN startplasma-x11
|
|
|
|
# Install packages
|
|
RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \
|
|
pacman -Syu --ask 4 --needed \
|
|
tigervnc \
|
|
cuda openssh vim pacman-contrib rsync git \
|
|
plasma konsole kate dolphin kompare kcalc \
|
|
jack2 ttf-dejavu \
|
|
firefox firefox-decentraleyes firefox-ublock-origin \
|
|
torbrowser-launcher \
|
|
shotwell ffmpegthumbs ark okular \
|
|
remmina libvncserver \
|
|
&& pacman -Scc --ask 4 \
|
|
&& echo 'Cmnd_Alias MISCELLANEOUS = /usr/bin/pacman -S' >/etc/sudoers.d/01-MISCELLANEOUS
|
|
|
|
# configure nvidia container runtime
|
|
# https://github.com/NVIDIA/nvidia-container-runtime#environment-variables-oci-spec
|
|
ENV NVIDIA_VISIBLE_DEVICES all
|
|
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
|
|
|
|
# Tigervnc
|
|
COPY 10-tigervnc.sh 90-tigervnc.sh /app/init.d/
|
|
RUN chmod +x /app/init.d/*
|
|
|
|
# Reset user home directory
|
|
USER user
|
|
WORKDIR /home/user
|
|
Dockerfile
|
|
|
|
## Plasma/tigervnc Setup
|
|
cat >10-tigervnc.sh <<- '10-tigervnc.sh'
|
|
#!/usr/bin/env bash
|
|
# Check for MYVNC_VNCPASS variable
|
|
if [ -z ${MYVNC_VNCPASS} ]
|
|
then
|
|
echo "MYVNC_VNCPASS env variable is missing"
|
|
exit 1
|
|
fi
|
|
|
|
# Configure tigervnc auth
|
|
if [ ! -f ~/.vnc/passwd ]
|
|
then
|
|
echo "${MYVNC_VNCPASS}" | vncpasswd -f >~/.vnc/passwd
|
|
chmod 0600 ~/.vnc/passwd
|
|
fi
|
|
|
|
# Remove VNCPASS env
|
|
unset MYVNC_VNCPASS
|
|
|
|
# VNC xstartup
|
|
install /dev/stdin ~/.vnc/xstartup <<- xstartup
|
|
#!/usr/bin/env bash
|
|
unset SESSION_MANAGER
|
|
unset DBUS_SESSION_BUS_ADDRESS
|
|
exec ${STARTXBIN}
|
|
xstartup
|
|
|
|
# Turn vnc sharing on/off
|
|
if [[ ${MYVNC_VNCSHARING} == "true" ]] || [[ ${MYVNC_VNCSHARING} == "1" ]]
|
|
then
|
|
_MYVNC_VNCSHARING=alwaysshared
|
|
else
|
|
_MYVNC_VNCSHARING=nevershared
|
|
fi
|
|
|
|
# VNC config
|
|
cat >~/.vnc/config <<- vncconfig
|
|
session=plasmax11
|
|
dpi=192
|
|
geometry=1920x1080
|
|
framerate=60
|
|
depth=32
|
|
${_MYVNC_VNCSHARING}
|
|
vncconfig
|
|
|
|
# Disable KDE screenlock
|
|
cat >~/.config/kscreenlockerrc <<- 'kscreenlockerrc'
|
|
[Daemon]
|
|
Autolock=false
|
|
LockOnResume=false
|
|
Timeout=0
|
|
kscreenlockerrc
|
|
|
|
# SSH config
|
|
if [ -f ~/.ssh/id_ed25519 ]
|
|
then
|
|
chmod 0600 ~/.ssh/id_ed25519
|
|
fi
|
|
10-tigervnc.sh
|
|
|
|
## TigerVNC launch script
|
|
cat >90-tigervnc.sh <<- '90-tigervnc.sh'
|
|
#!/usr/bin/env bash
|
|
# Launch Tigervnc
|
|
/usr/bin/dbus-launch vncserver :0 &
|
|
90-tigervnc.sh
|
|
|
|
## Docker build
|
|
DOCKER_BUILDKIT=1 docker build ./. \
|
|
--tag myvnc/kdeplasma \
|
|
&& rm -f Dockerfile *.sh |