|
|
@@ -1,97 +1,17 @@
|
|
|
# syntax=docker/dockerfile:1.7
|
|
|
|
|
|
-# Final target:
|
|
|
-# Ubuntu 24.04 + NVIDIA GLX + XFCE + PipeWire + Firefox + Selkies
|
|
|
+# Ubuntu 24.04 + NVIDIA GLX + XFCE + PipeWire + Firefox.
|
|
|
#
|
|
|
-# The build uses intermediate stages, but produces a single final image.
|
|
|
+# Important: the Selkies GStreamer runtime, Python wheel, web client and
|
|
|
+# joystick interposer all come from the SAME published Selkies release.
|
|
|
+# Do not mix these assets with py-build:main or a frontend built from main.
|
|
|
|
|
|
ARG DISTRIB_RELEASE=24.04
|
|
|
-ARG SELKIES_IMAGE=ghcr.io/selkies-project/selkies/py-build:main
|
|
|
-
|
|
|
-ARG SELKIES_GIT_REF=main
|
|
|
+ARG SELKIES_VERSION=1.6.2
|
|
|
ARG NVIDIA_VAAPI_DRIVER_VERSION=latest
|
|
|
|
|
|
-
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-# Current Selkies wheel
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-
|
|
|
-FROM ${SELKIES_IMAGE} AS selkies-build
|
|
|
-
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-# Selkies joystick interposer
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-
|
|
|
-# Build the Selkies joystick interposer directly from its official source.
|
|
|
-FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS selkies-js-interposer-builder
|
|
|
-
|
|
|
-ARG DEBIAN_FRONTEND=noninteractive
|
|
|
-ARG SELKIES_GIT_REF
|
|
|
-
|
|
|
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
-
|
|
|
-RUN apt-get update \
|
|
|
- && apt-get install --no-install-recommends -y \
|
|
|
- build-essential \
|
|
|
- ca-certificates \
|
|
|
- curl \
|
|
|
- && rm -rf /var/lib/apt/lists/*
|
|
|
-
|
|
|
-RUN set -eux; \
|
|
|
- curl -fsSL \
|
|
|
- "https://raw.githubusercontent.com/selkies-project/selkies/${SELKIES_GIT_REF}/addons/js-interposer/joystick_interposer.c" \
|
|
|
- -o /tmp/joystick_interposer.c; \
|
|
|
- install -d -m 0755 /out; \
|
|
|
- gcc -shared -fPIC -O2 \
|
|
|
- -Wl,-z,relro,-z,now \
|
|
|
- -o /out/selkies_joystick_interposer.so \
|
|
|
- /tmp/joystick_interposer.c \
|
|
|
- -ldl; \
|
|
|
- test -s /out/selkies_joystick_interposer.so
|
|
|
-
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-# Build the Selkies Python environment
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-
|
|
|
-FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS selkies-runtime-builder
|
|
|
-
|
|
|
-ARG DEBIAN_FRONTEND=noninteractive
|
|
|
-
|
|
|
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
-
|
|
|
-COPY --from=selkies-build /opt/pypi/dist/selkies-*.whl /tmp/
|
|
|
-
|
|
|
-RUN apt-get update \
|
|
|
- && apt-get install --no-install-recommends -y \
|
|
|
- build-essential \
|
|
|
- libsm6 \
|
|
|
- libopus0 \
|
|
|
- libpulse0 \
|
|
|
- libxkbcommon-dev \
|
|
|
- pkg-config \
|
|
|
- python3 \
|
|
|
- python3-dev \
|
|
|
- python3-pip \
|
|
|
- python3-venv \
|
|
|
- && python3 -m venv /opt/selkies \
|
|
|
- && /opt/selkies/bin/python -m pip install \
|
|
|
- --no-cache-dir \
|
|
|
- --upgrade \
|
|
|
- pip \
|
|
|
- setuptools \
|
|
|
- wheel \
|
|
|
- && printf '%s\n' \
|
|
|
- 'pixelflux==1.6.4' \
|
|
|
- 'pcmflux==1.0.8' \
|
|
|
- > /tmp/selkies-constraints.txt \
|
|
|
- && /opt/selkies/bin/python -m pip install \
|
|
|
- --no-cache-dir \
|
|
|
- --force-reinstall \
|
|
|
- --constraint /tmp/selkies-constraints.txt \
|
|
|
- /tmp/selkies-*.whl
|
|
|
-
|
|
|
# -----------------------------------------------------------------------------
|
|
|
-# Build the current nvidia-vaapi-driver without retaining build dependencies
|
|
|
+# Build nvidia-vaapi-driver without retaining its build dependencies
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS nvidia-vaapi-builder
|
|
|
@@ -127,147 +47,15 @@ RUN set -eux; \
|
|
|
curl -fsSL \
|
|
|
"https://github.com/elFarto/nvidia-vaapi-driver/archive/refs/tags/v${version}.tar.gz" \
|
|
|
-o /tmp/nvidia-vaapi-driver.tar.gz; \
|
|
|
- mkdir -p /tmp/nvidia-vaapi-driver; \
|
|
|
+ install -d -m 0755 /tmp/nvidia-vaapi-driver; \
|
|
|
tar -xzf /tmp/nvidia-vaapi-driver.tar.gz \
|
|
|
--strip-components=1 \
|
|
|
-C /tmp/nvidia-vaapi-driver; \
|
|
|
cd /tmp/nvidia-vaapi-driver; \
|
|
|
- meson setup build \
|
|
|
- --prefix=/usr \
|
|
|
- --buildtype=release; \
|
|
|
+ meson setup build --prefix=/usr --buildtype=release; \
|
|
|
meson compile -C build; \
|
|
|
DESTDIR=/out meson install -C build
|
|
|
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-# Build the Selkies web frontend from the official source repository
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-
|
|
|
-FROM docker.io/library/node:22-bookworm-slim AS selkies-web-builder
|
|
|
-
|
|
|
-ARG DEBIAN_FRONTEND=noninteractive
|
|
|
-ARG SELKIES_GIT_REF=main
|
|
|
-ARG SELKIES_MODE=websockets
|
|
|
-ARG SELKIES_UPLOAD_DIR=/home/ubuntu/Desktop
|
|
|
-
|
|
|
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
-
|
|
|
-RUN apt-get update \
|
|
|
- && apt-get install --no-install-recommends -y \
|
|
|
- ca-certificates \
|
|
|
- cmake \
|
|
|
- curl \
|
|
|
- git \
|
|
|
- && rm -rf /var/lib/apt/lists/*
|
|
|
-
|
|
|
-WORKDIR /tmp/selkies
|
|
|
-
|
|
|
-RUN curl -fsSL \
|
|
|
- "https://github.com/selkies-project/selkies/archive/${SELKIES_GIT_REF}.tar.gz" \
|
|
|
- -o /tmp/selkies.tar.gz \
|
|
|
- && tar -xzf /tmp/selkies.tar.gz \
|
|
|
- --strip-components=1 \
|
|
|
- -C /tmp/selkies \
|
|
|
- && rm -f /tmp/selkies.tar.gz
|
|
|
-
|
|
|
-RUN set -eux; \
|
|
|
- cd /tmp/selkies/addons/selkies-web-core; \
|
|
|
- npm install; \
|
|
|
- npm run build; \
|
|
|
- \
|
|
|
- cd /tmp/selkies/addons/selkies-dashboard; \
|
|
|
- cp ../selkies-web-core/dist/selkies-core.js src/; \
|
|
|
- npm install; \
|
|
|
- SELKIES_INJECT=1 \
|
|
|
- SELKIES_MODE="${SELKIES_MODE}" \
|
|
|
- SELKIES_UPLOAD_DIR="${SELKIES_UPLOAD_DIR}" \
|
|
|
- npm run build; \
|
|
|
- \
|
|
|
- mkdir -p dist/src; \
|
|
|
- cp ../selkies-web-core/dist/selkies-core.js dist/src/; \
|
|
|
- cp ../universal-touch-gamepad/universalTouchGamepad.js dist/src/; \
|
|
|
- cp -r ../selkies-web-core/dist/jsdb dist/; \
|
|
|
- \
|
|
|
- mkdir -p /out; \
|
|
|
- cp -a dist/. /out/; \
|
|
|
- test -f /out/index.html
|
|
|
-
|
|
|
-
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-# Build the legacy Pixelflux capture library required by pixelflux 1.6.4
|
|
|
-# -----------------------------------------------------------------------------
|
|
|
-
|
|
|
-FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS pixelflux-legacy-builder
|
|
|
-
|
|
|
-ARG DEBIAN_FRONTEND=noninteractive
|
|
|
-ARG PIXELFLUX_VERSION=1.6.4
|
|
|
-
|
|
|
-SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
-
|
|
|
-RUN apt-get update \
|
|
|
- && apt-get install --no-install-recommends -y \
|
|
|
- ca-certificates \
|
|
|
- curl \
|
|
|
- g++ \
|
|
|
- pkg-config \
|
|
|
- libavcodec-dev \
|
|
|
- libavutil-dev \
|
|
|
- libdrm-dev \
|
|
|
- libjpeg-dev \
|
|
|
- libva-dev \
|
|
|
- libx11-dev \
|
|
|
- libx264-dev \
|
|
|
- libxext-dev \
|
|
|
- libxfixes-dev \
|
|
|
- libyuv-dev \
|
|
|
- && rm -rf /var/lib/apt/lists/*
|
|
|
-
|
|
|
-WORKDIR /tmp/pixelflux
|
|
|
-
|
|
|
-RUN set -eux; \
|
|
|
- curl -fsSL \
|
|
|
- "https://codeload.github.com/linuxserver/pixelflux/tar.gz/refs/tags/${PIXELFLUX_VERSION}" \
|
|
|
- -o /tmp/pixelflux.tar.gz; \
|
|
|
- tar -xzf /tmp/pixelflux.tar.gz \
|
|
|
- --strip-components=1 \
|
|
|
- -C /tmp/pixelflux; \
|
|
|
- install -d -m 0755 /out; \
|
|
|
- test -f /usr/include/va/va.h; \
|
|
|
- test -f /usr/include/va/va_drm.h; \
|
|
|
- test -f /usr/include/libdrm/drm.h; \
|
|
|
- pkg-config --exists \
|
|
|
- libavcodec \
|
|
|
- libavutil \
|
|
|
- libva \
|
|
|
- libdrm \
|
|
|
- x11 \
|
|
|
- xext \
|
|
|
- xfixes; \
|
|
|
- g++ \
|
|
|
- -std=c++17 \
|
|
|
- -Wno-unused-function \
|
|
|
- -fPIC \
|
|
|
- -O2 \
|
|
|
- -shared \
|
|
|
- -Ipixelflux/include \
|
|
|
- -o /out/screen_capture_module.so \
|
|
|
- pixelflux/screen_capture_module.cpp \
|
|
|
- pixelflux/include/xxhash.c \
|
|
|
- -lX11 \
|
|
|
- -lXext \
|
|
|
- -lXfixes \
|
|
|
- -ljpeg \
|
|
|
- -lx264 \
|
|
|
- -lyuv \
|
|
|
- -ldl \
|
|
|
- -lavcodec \
|
|
|
- -lavutil; \
|
|
|
- test -s /out/screen_capture_module.so; \
|
|
|
- ldd /out/screen_capture_module.so | tee /tmp/pixelflux-ldd.txt; \
|
|
|
- if grep -q "not found" /tmp/pixelflux-ldd.txt; then \
|
|
|
- echo "Missing Pixelflux shared-library dependency"; \
|
|
|
- exit 1; \
|
|
|
- fi
|
|
|
-
|
|
|
# -----------------------------------------------------------------------------
|
|
|
# Final image
|
|
|
# -----------------------------------------------------------------------------
|
|
|
@@ -276,14 +64,15 @@ FROM docker.io/library/ubuntu:${DISTRIB_RELEASE}
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
ARG DISTRIB_RELEASE
|
|
|
-ARG TZ=UTC
|
|
|
+ARG SELKIES_VERSION
|
|
|
+ARG TZ=Europe/Paris
|
|
|
ARG USER_NAME=ubuntu
|
|
|
ARG USER_UID=1000
|
|
|
ARG USER_GID=1000
|
|
|
|
|
|
LABEL org.opencontainers.image.title="Selkies NVIDIA XFCE Desktop" \
|
|
|
- org.opencontainers.image.description="XFCE remote desktop with Selkies, PipeWire and NVIDIA acceleration" \
|
|
|
- org.opencontainers.image.source="https://github.com/selkies-project/selkies"
|
|
|
+ org.opencontainers.image.description="XFCE remote desktop using the stable Selkies GStreamer release stack" \
|
|
|
+ org.opencontainers.image.source="https://github.com/selkies-project/docker-selkies-glx-desktop"
|
|
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
|
@@ -303,9 +92,10 @@ ENV TZ="${TZ}" \
|
|
|
XDG_SESSION_DESKTOP="xfce" \
|
|
|
XDG_CURRENT_DESKTOP="XFCE" \
|
|
|
XDG_SESSION_TYPE="x11" \
|
|
|
- SELKIES_MODE="websockets" \
|
|
|
+ NGINX_PORT="8080" \
|
|
|
SELKIES_PORT="8081" \
|
|
|
- SELKIES_ENCODER="x264enc" \
|
|
|
+ SELKIES_ENCODER="nvh264enc" \
|
|
|
+ SELKIES_ENABLE_HTTPS="false" \
|
|
|
SELKIES_ENABLE_RESIZE="false" \
|
|
|
SELKIES_ENABLE_BASIC_AUTH="true" \
|
|
|
NVIDIA_VISIBLE_DEVICES="all" \
|
|
|
@@ -323,9 +113,10 @@ ENV TZ="${TZ}" \
|
|
|
PULSE_SERVER="unix:/tmp/runtime-ubuntu/pulse/native" \
|
|
|
DBUS_SYSTEM_BUS_ADDRESS="unix:path=/tmp/runtime-ubuntu/dbus-system-bus" \
|
|
|
APPIMAGE_EXTRACT_AND_RUN="1" \
|
|
|
- SUDO_EDITOR="mousepad"
|
|
|
+ SUDO_EDITOR="mousepad" \
|
|
|
+ PIP_BREAK_SYSTEM_PACKAGES="1"
|
|
|
|
|
|
-# Bootstrap packages needed to configure APT repositories.
|
|
|
+# Bootstrap APT and locales.
|
|
|
RUN apt-get update \
|
|
|
&& apt-get install --no-install-recommends -y \
|
|
|
ca-certificates \
|
|
|
@@ -339,7 +130,7 @@ RUN apt-get update \
|
|
|
&& echo "${TZ}" > /etc/timezone \
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
-# Keep the same Mozilla and PipeWire repositories as the original image.
|
|
|
+# Firefox DEB and the same PipeWire/WirePlumber PPAs as the original image.
|
|
|
RUN install -d -m 0755 \
|
|
|
/etc/apt/preferences.d \
|
|
|
/etc/apt/sources.list.d \
|
|
|
@@ -367,17 +158,21 @@ RUN install -d -m 0755 \
|
|
|
"deb https://ppa.launchpadcontent.net/pipewire-debian/wireplumber-upstream/ubuntu noble main" \
|
|
|
> /etc/apt/sources.list.d/wireplumber-upstream.list
|
|
|
|
|
|
-# Base system, desktop, Xorg, NVIDIA runtime interfaces and user tools.
|
|
|
-# There are deliberately no Intel/AMD VA-API or Vulkan drivers and no i386
|
|
|
-# architecture.
|
|
|
+# Desktop, Xorg, NVIDIA interfaces, PipeWire and the dependencies used by the
|
|
|
+# original Selkies GStreamer release. No KDE, Chrome, Wine, KasmVNC, RustDesk,
|
|
|
+# i386 stack, Intel VA-API stack or AMD/Mesa Vulkan stack.
|
|
|
RUN apt-get update \
|
|
|
&& apt-get install --no-install-recommends -y \
|
|
|
+ apache2-utils \
|
|
|
apt-utils \
|
|
|
+ alsa-utils \
|
|
|
+ aom-tools \
|
|
|
bash-completion \
|
|
|
binutils \
|
|
|
btop \
|
|
|
bzip2 \
|
|
|
clinfo \
|
|
|
+ coturn \
|
|
|
dbus-user-session \
|
|
|
dbus-x11 \
|
|
|
desktop-file-utils \
|
|
|
@@ -393,7 +188,12 @@ RUN apt-get update \
|
|
|
fonts-ubuntu \
|
|
|
fuse \
|
|
|
git \
|
|
|
+ glib-networking \
|
|
|
+ gstreamer1.0-libcamera \
|
|
|
+ gstreamer1.0-pipewire \
|
|
|
+ gstreamer1.0-plugins-bad \
|
|
|
gvfs \
|
|
|
+ jackd2 \
|
|
|
jq \
|
|
|
kmod \
|
|
|
less \
|
|
|
@@ -401,23 +201,35 @@ RUN apt-get update \
|
|
|
libegl1 \
|
|
|
libelf-dev \
|
|
|
libgcrypt20 \
|
|
|
+ libgirepository-1.0-1 \
|
|
|
libgl1 \
|
|
|
libgles1 \
|
|
|
libgles2 \
|
|
|
- libglu1-mesa \
|
|
|
+ libglib2.0-0 \
|
|
|
libglvnd-dev \
|
|
|
libglvnd0 \
|
|
|
libglx0 \
|
|
|
libgstreamer-plugins-bad1.0-0 \
|
|
|
+ libgudev-1.0-0 \
|
|
|
+ libjack-jackd2-0 \
|
|
|
+ libopenh264-dev \
|
|
|
libopengl0 \
|
|
|
libopus0 \
|
|
|
libpci3 \
|
|
|
+ libpipewire-0.3-modules \
|
|
|
+ libpipewire-module-x11-bell \
|
|
|
libpulse0 \
|
|
|
libsm6 \
|
|
|
+ libspa-0.2-bluetooth \
|
|
|
+ libspa-0.2-jack \
|
|
|
+ libspa-0.2-modules \
|
|
|
libva-drm2 \
|
|
|
libva-x11-2 \
|
|
|
libva2 \
|
|
|
+ libvpx-dev \
|
|
|
libvulkan1 \
|
|
|
+ libwayland-dev \
|
|
|
+ libwayland-egl1 \
|
|
|
libx11-6 \
|
|
|
libx11-xcb1 \
|
|
|
libxau6 \
|
|
|
@@ -434,17 +246,32 @@ RUN apt-get update \
|
|
|
nano \
|
|
|
neofetch \
|
|
|
net-tools \
|
|
|
+ netcat-openbsd \
|
|
|
+ nginx \
|
|
|
ocl-icd-libopencl1 \
|
|
|
pavucontrol \
|
|
|
pciutils \
|
|
|
+ pipewire \
|
|
|
+ pipewire-alsa \
|
|
|
+ pipewire-audio-client-libraries \
|
|
|
+ pipewire-jack \
|
|
|
+ pipewire-libcamera \
|
|
|
+ pipewire-locales \
|
|
|
+ pipewire-v4l2 \
|
|
|
+ pipewire-vulkan \
|
|
|
procps \
|
|
|
psmisc \
|
|
|
python3 \
|
|
|
+ python3-dev \
|
|
|
+ python3-gi \
|
|
|
python3-pip \
|
|
|
+ python3-setuptools \
|
|
|
python3-venv \
|
|
|
+ python3-wheel \
|
|
|
ristretto \
|
|
|
sudo \
|
|
|
supervisor \
|
|
|
+ svt-av1 \
|
|
|
thunar \
|
|
|
tumbler \
|
|
|
udev \
|
|
|
@@ -452,7 +279,10 @@ RUN apt-get update \
|
|
|
vainfo \
|
|
|
vim \
|
|
|
vulkan-tools \
|
|
|
+ wayland-protocols \
|
|
|
wget \
|
|
|
+ wireplumber \
|
|
|
+ wireplumber-locales \
|
|
|
wmctrl \
|
|
|
x11-apps \
|
|
|
x11-utils \
|
|
|
@@ -485,32 +315,13 @@ RUN apt-get update \
|
|
|
xz-utils \
|
|
|
zip \
|
|
|
zstd \
|
|
|
- pipewire \
|
|
|
- pipewire-alsa \
|
|
|
- pipewire-audio-client-libraries \
|
|
|
- pipewire-jack \
|
|
|
- pipewire-libcamera \
|
|
|
- pipewire-locales \
|
|
|
- pipewire-v4l2 \
|
|
|
- pipewire-vulkan \
|
|
|
- gstreamer1.0-libcamera \
|
|
|
- gstreamer1.0-pipewire \
|
|
|
gir1.2-wp-0.5 \
|
|
|
- libpipewire-0.3-modules \
|
|
|
- libpipewire-module-x11-bell \
|
|
|
- libspa-0.2-bluetooth \
|
|
|
- libspa-0.2-jack \
|
|
|
- libspa-0.2-modules \
|
|
|
- wireplumber \
|
|
|
- wireplumber-locales \
|
|
|
- apache2-utils \
|
|
|
- nginx \
|
|
|
- netcat-openbsd \
|
|
|
- libavcodec60 \
|
|
|
- libavutil58 \
|
|
|
- libjpeg-turbo8 \
|
|
|
- libx264-164 \
|
|
|
- libyuv0 \
|
|
|
+ && sed -i \
|
|
|
+ -e 's#/var/log/nginx/access\.log#/dev/stdout#g' \
|
|
|
+ -e 's#/var/log/nginx/error\.log#/dev/stderr#g' \
|
|
|
+ -e 's#/run/nginx\.pid#/tmp/nginx.pid#g' \
|
|
|
+ /etc/nginx/nginx.conf \
|
|
|
+ && printf '\nerror_log /dev/stderr;\n' >> /etc/nginx/nginx.conf \
|
|
|
&& apt-get clean \
|
|
|
&& rm -rf \
|
|
|
/var/lib/apt/lists/* \
|
|
|
@@ -520,10 +331,10 @@ RUN apt-get update \
|
|
|
/tmp/* \
|
|
|
/var/tmp/*
|
|
|
|
|
|
-# Install only the compiled NVIDIA VA-API runtime from the builder stage.
|
|
|
+# Keep only the compiled NVIDIA VA-API runtime.
|
|
|
COPY --from=nvidia-vaapi-builder /out/usr/ /usr/
|
|
|
|
|
|
-# Make NVIDIA libraries injected by NVIDIA Container Toolkit discoverable.
|
|
|
+# NVIDIA libraries are injected by the NVIDIA GPU Operator / Container Toolkit.
|
|
|
RUN printf '%s\n' \
|
|
|
'/usr/local/nvidia/lib' \
|
|
|
'/usr/local/nvidia/lib64' \
|
|
|
@@ -534,7 +345,7 @@ RUN printf '%s\n' \
|
|
|
/usr/share/glvnd/egl_vendor.d \
|
|
|
&& echo 'libnvidia-opencl.so.1' \
|
|
|
> /etc/OpenCL/vendors/nvidia.icd \
|
|
|
- && cat > /etc/vulkan/icd.d/nvidia_icd.json <<'EOF'
|
|
|
+ && cat > /etc/vulkan/icd.d/nvidia_icd.json <<'JSON'
|
|
|
{
|
|
|
"file_format_version": "1.0.0",
|
|
|
"ICD": {
|
|
|
@@ -542,50 +353,56 @@ RUN printf '%s\n' \
|
|
|
"api_version": "1.3.0"
|
|
|
}
|
|
|
}
|
|
|
-EOF
|
|
|
+JSON
|
|
|
|
|
|
-RUN cat > /usr/share/glvnd/egl_vendor.d/10_nvidia.json <<'EOF'
|
|
|
+RUN cat > /usr/share/glvnd/egl_vendor.d/10_nvidia.json <<'JSON'
|
|
|
{
|
|
|
"file_format_version": "1.0.0",
|
|
|
"ICD": {
|
|
|
"library_path": "libEGL_nvidia.so.0"
|
|
|
}
|
|
|
}
|
|
|
-EOF
|
|
|
+JSON
|
|
|
|
|
|
-ENV PATH="/opt/selkies/bin:/usr/local/nvidia/bin:${PATH}" \
|
|
|
+ENV PATH="/usr/local/nvidia/bin:${PATH}" \
|
|
|
LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64"
|
|
|
|
|
|
-# Install the Selkies wheel from the official stable build image.
|
|
|
-COPY --from=selkies-runtime-builder /opt/selkies /opt/selkies
|
|
|
-
|
|
|
-COPY --from=pixelflux-legacy-builder \
|
|
|
- /out/screen_capture_module.so \
|
|
|
- /tmp/screen_capture_module.so
|
|
|
-
|
|
|
+# Install every Selkies component from the same stable v1.6.2 release.
|
|
|
RUN set -eux; \
|
|
|
- PIXELFLUX_DIR="$(/opt/selkies/bin/python -c \
|
|
|
- 'from pathlib import Path; import pixelflux; print(Path(pixelflux.__file__).resolve().parent)')"; \
|
|
|
- install -m 0755 \
|
|
|
- /tmp/screen_capture_module.so \
|
|
|
- "${PIXELFLUX_DIR}/screen_capture_module.so"; \
|
|
|
- ldd "${PIXELFLUX_DIR}/screen_capture_module.so"; \
|
|
|
- test -z "$(ldd "${PIXELFLUX_DIR}/screen_capture_module.so" | grep 'not found' || true)"; \
|
|
|
- rm -f /tmp/screen_capture_module.so
|
|
|
-
|
|
|
-COPY --chown=${USER_UID}:${USER_GID} \
|
|
|
- --from=selkies-web-builder \
|
|
|
- /out/ \
|
|
|
- /opt/selkies-web/
|
|
|
-
|
|
|
-COPY --from=selkies-js-interposer-builder \
|
|
|
- /out/selkies_joystick_interposer.so \
|
|
|
- /usr/local/lib/selkies_joystick_interposer.so
|
|
|
-
|
|
|
-RUN chmod 0755 /usr/local/lib/selkies_joystick_interposer.so
|
|
|
-
|
|
|
-# Create the regular desktop user. sudo-root is kept because Xorg and the
|
|
|
-# NVIDIA userspace installer need a few targeted root operations at runtime.
|
|
|
+ ubuntu_version="$(. /etc/os-release; printf '%s' "${VERSION_ID}")"; \
|
|
|
+ arch="$(dpkg --print-architecture)"; \
|
|
|
+ release_url="https://github.com/selkies-project/selkies/releases/download/v${SELKIES_VERSION}"; \
|
|
|
+ curl -fsSL \
|
|
|
+ "${release_url}/gstreamer-selkies_gpl_v${SELKIES_VERSION}_ubuntu${ubuntu_version}_${arch}.tar.gz" \
|
|
|
+ | tar -xzf - -C /opt; \
|
|
|
+ curl -fsSL \
|
|
|
+ "${release_url}/selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl" \
|
|
|
+ -o /tmp/selkies-gstreamer.whl; \
|
|
|
+ python3 -m pip install \
|
|
|
+ --break-system-packages \
|
|
|
+ --no-cache-dir \
|
|
|
+ --force-reinstall \
|
|
|
+ /tmp/selkies-gstreamer.whl \
|
|
|
+ 'websockets<14.0'; \
|
|
|
+ curl -fsSL \
|
|
|
+ "${release_url}/selkies-gstreamer-web_v${SELKIES_VERSION}.tar.gz" \
|
|
|
+ | tar -xzf - -C /opt; \
|
|
|
+ curl -fsSL \
|
|
|
+ "${release_url}/selkies-js-interposer_v${SELKIES_VERSION}_ubuntu${ubuntu_version}_${arch}.deb" \
|
|
|
+ -o /tmp/selkies-js-interposer.deb; \
|
|
|
+ apt-get update; \
|
|
|
+ apt-get install --no-install-recommends -y \
|
|
|
+ /tmp/selkies-js-interposer.deb; \
|
|
|
+ test -f /opt/gst-web/index.html; \
|
|
|
+ test -f /opt/gstreamer/gst-env; \
|
|
|
+ command -v selkies-gstreamer; \
|
|
|
+ rm -f \
|
|
|
+ /tmp/selkies-gstreamer.whl \
|
|
|
+ /tmp/selkies-js-interposer.deb; \
|
|
|
+ apt-get clean; \
|
|
|
+ rm -rf /var/lib/apt/lists/* /var/cache/apt/* /tmp/* /var/tmp/*
|
|
|
+
|
|
|
+# Regular desktop user and the permissions required by the original entrypoints.
|
|
|
RUN set -eux; \
|
|
|
if ! getent group "${USER_NAME}" >/dev/null; then \
|
|
|
groupadd --gid "${USER_GID}" "${USER_NAME}"; \
|
|
|
@@ -615,27 +432,22 @@ RUN set -eux; \
|
|
|
cp -a /usr/bin/sudo /usr/bin/sudo-root; \
|
|
|
chown root:root /usr/bin/sudo-root; \
|
|
|
chmod 4755 /usr/bin/sudo-root; \
|
|
|
- install -d \
|
|
|
- -o "${USER_UID}" \
|
|
|
- -g "${USER_GID}" \
|
|
|
- -m 0700 \
|
|
|
+ install -d -o "${USER_UID}" -g "${USER_GID}" -m 0700 \
|
|
|
/tmp/runtime-ubuntu; \
|
|
|
chown -R \
|
|
|
"${USER_UID}:${USER_GID}" \
|
|
|
"/home/${USER_NAME}" \
|
|
|
/etc/X11 \
|
|
|
- /opt/selkies
|
|
|
+ /etc/nginx \
|
|
|
+ /opt/gstreamer \
|
|
|
+ /opt/gst-web \
|
|
|
+ /var/lib/nginx
|
|
|
|
|
|
-# XFCE defaults suitable for a permanently streamed desktop.
|
|
|
+# XFCE defaults for a permanently streamed desktop.
|
|
|
RUN install -d -m 0755 \
|
|
|
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml \
|
|
|
/etc/firefox/policies \
|
|
|
- && if [[ -f /etc/xdg/xfce4/panel/default.xml ]]; then \
|
|
|
- cp -f \
|
|
|
- /etc/xdg/xfce4/panel/default.xml \
|
|
|
- /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml; \
|
|
|
- fi \
|
|
|
- && cat > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml <<'EOF'
|
|
|
+ && cat > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml <<'XML'
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<channel name="xfce4-power-manager" version="1.0">
|
|
|
<property name="xfce4-power-manager" type="empty">
|
|
|
@@ -644,9 +456,9 @@ RUN install -d -m 0755 \
|
|
|
<property name="lock-screen-suspend-hibernate" type="bool" value="false"/>
|
|
|
</property>
|
|
|
</channel>
|
|
|
-EOF
|
|
|
+XML
|
|
|
|
|
|
-RUN cat > /etc/firefox/policies/policies.json <<'EOF'
|
|
|
+RUN cat > /etc/firefox/policies/policies.json <<'JSON'
|
|
|
{
|
|
|
"policies": {
|
|
|
"Preferences": {
|
|
|
@@ -669,28 +481,52 @@ RUN cat > /etc/firefox/policies/policies.json <<'EOF'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-EOF
|
|
|
+JSON
|
|
|
|
|
|
-RUN update-alternatives --set x-www-browser /usr/bin/firefox \
|
|
|
- || true
|
|
|
+RUN update-alternatives --set x-www-browser /usr/bin/firefox || true
|
|
|
|
|
|
-# The three files below must be placed beside this Dockerfile.
|
|
|
+# Keep the ORIGINAL entrypoint and Selkies GStreamer entrypoint.
|
|
|
+# Replace supervisord.conf with the cleaned version supplied with this file.
|
|
|
COPY --chown=${USER_UID}:${USER_GID} entrypoint.sh /etc/entrypoint.sh
|
|
|
-COPY --chown=${USER_UID}:${USER_GID} selkies-entrypoint.sh /etc/selkies-entrypoint.sh
|
|
|
+COPY --chown=${USER_UID}:${USER_GID} selkies-gstreamer-entrypoint.sh /etc/selkies-gstreamer-entrypoint.sh
|
|
|
COPY --chown=${USER_UID}:${USER_GID} supervisord.conf /etc/supervisord.conf
|
|
|
-COPY --chown=${USER_UID}:${USER_GID} nginx.conf /etc/nginx/nginx.conf
|
|
|
-COPY --chown=${USER_UID}:${USER_GID} nginx-entrypoint.sh /etc/nginx-entrypoint.sh
|
|
|
|
|
|
RUN sed -i 's/\r$//' \
|
|
|
/etc/entrypoint.sh \
|
|
|
- /etc/selkies-entrypoint.sh \
|
|
|
- /etc/nginx-entrypoint.sh \
|
|
|
- && chmod 0755 \
|
|
|
+ /etc/selkies-gstreamer-entrypoint.sh \
|
|
|
+ /etc/supervisord.conf \
|
|
|
+ && chmod 0755 \
|
|
|
/etc/entrypoint.sh \
|
|
|
- /etc/selkies-entrypoint.sh \
|
|
|
- /etc/nginx-entrypoint.sh \
|
|
|
+ /etc/selkies-gstreamer-entrypoint.sh \
|
|
|
/etc/supervisord.conf
|
|
|
|
|
|
+# Original coTURN helper used by selkies-gstreamer-entrypoint.sh.
|
|
|
+RUN cat > /etc/start-turnserver.sh <<'EOF_TURN'
|
|
|
+#!/bin/bash
|
|
|
+set -e
|
|
|
+exec turnserver \
|
|
|
+ --verbose \
|
|
|
+ --listening-ip="0.0.0.0" \
|
|
|
+ --listening-ip="::" \
|
|
|
+ --listening-port="${SELKIES_TURN_PORT:-3478}" \
|
|
|
+ --realm="${TURN_REALM:-example.com}" \
|
|
|
+ --external-ip="${TURN_EXTERNAL_IP:-127.0.0.1}" \
|
|
|
+ --min-port="${TURN_MIN_PORT:-49152}" \
|
|
|
+ --max-port="${TURN_MAX_PORT:-65535}" \
|
|
|
+ --channel-lifetime="${TURN_CHANNEL_LIFETIME:--1}" \
|
|
|
+ --lt-cred-mech \
|
|
|
+ --user="selkies:${TURN_RANDOM_PASSWORD}" \
|
|
|
+ --no-cli \
|
|
|
+ --cli-password="${TURN_RANDOM_PASSWORD}" \
|
|
|
+ --userdb="${XDG_RUNTIME_DIR:-/tmp}/turnserver-turndb" \
|
|
|
+ --pidfile="${XDG_RUNTIME_DIR:-/tmp}/turnserver.pid" \
|
|
|
+ --log-file="stdout" \
|
|
|
+ --allow-loopback-peers \
|
|
|
+ ${TURN_EXTRA_ARGS} "$@"
|
|
|
+EOF_TURN
|
|
|
+
|
|
|
+RUN chmod 0755 /etc/start-turnserver.sh
|
|
|
+
|
|
|
USER ${USER_UID}:${USER_GID}
|
|
|
|
|
|
ENV USER="${USER_NAME}" \
|