Penta 1 mesiac pred
commit
a5edce4790
2 zmenil súbory, kde vykonal 106 pridanie a 0 odobranie
  1. 45 0
      Dockerfile
  2. 61 0
      sunshine-entrypoint.sh

+ 45 - 0
Dockerfile

@@ -0,0 +1,45 @@
+# syntax=docker/dockerfile:1.7
+
+ARG SUNSHINE_VERSION=v2026.811.155620
+
+# On récupère le paquet Sunshine depuis l'image officielle.
+FROM ghcr.io/lizardbyte/sunshine:${SUNSHINE_VERSION}-ubuntu-24.04 AS sunshine
+
+# PoC : on réutilise volontairement notre environnement graphique déjà validé.
+FROM image-registry.openshift-image-registry.svc:5000/desktop/desktop:latest
+
+USER root
+
+# L'image Sunshine officielle conserve le .deb utilisé pour installer Sunshine.
+COPY --from=sunshine /sunshine.deb /tmp/sunshine.deb
+
+RUN apt-get update \
+    && apt-get install --no-install-recommends -y /tmp/sunshine.deb \
+    && rm -f /tmp/sunshine.deb \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
+
+COPY sunshine-entrypoint.sh /etc/sunshine-entrypoint.sh
+
+RUN sed -i 's/\r$//' /etc/sunshine-entrypoint.sh \
+    && chmod 0755 /etc/sunshine-entrypoint.sh
+
+USER 1000:1000
+
+ENV DISPLAY=:20 \
+    HOME=/home/ubuntu \
+    USER=ubuntu \
+    XDG_RUNTIME_DIR=/tmp/runtime-ubuntu \
+    PIPEWIRE_RUNTIME_DIR=/tmp/runtime-ubuntu \
+    PULSE_RUNTIME_PATH=/tmp/runtime-ubuntu/pulse \
+    PULSE_SERVER=unix:/tmp/runtime-ubuntu/pulse/native \
+    NVIDIA_VISIBLE_DEVICES=all \
+    NVIDIA_DRIVER_CAPABILITIES=all
+
+WORKDIR /home/ubuntu
+
+EXPOSE 47984-47990/tcp
+EXPOSE 48010/tcp
+EXPOSE 47998-48000/udp
+
+ENTRYPOINT ["/etc/sunshine-entrypoint.sh"]

+ 61 - 0
sunshine-entrypoint.sh

@@ -0,0 +1,61 @@
+#!/bin/bash
+set -euo pipefail
+
+echo "=============================================================="
+echo " Sunshine Gaming Desktop"
+echo "=============================================================="
+
+echo
+echo "Starting existing desktop stack..."
+
+# On conserve temporairement tout le mécanisme Selkies existant :
+# Xorg NVIDIA, XFCE, PipeWire, WirePlumber, D-Bus, etc.
+/usr/bin/supervisord -c /etc/supervisord.conf &
+
+SUPERVISOR_PID=$!
+
+cleanup() {
+    echo "Stopping supervisor..."
+    kill "${SUPERVISOR_PID}" 2>/dev/null || true
+    wait "${SUPERVISOR_PID}" 2>/dev/null || true
+}
+
+trap cleanup EXIT TERM INT
+
+echo
+echo "Waiting for Xorg on ${DISPLAY}..."
+
+for i in $(seq 1 60); do
+    if xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; then
+        echo "Xorg is ready."
+        break
+    fi
+
+    if ! kill -0 "${SUPERVISOR_PID}" 2>/dev/null; then
+        echo "ERROR: supervisord exited before Xorg became available."
+        exit 1
+    fi
+
+    if [ "${i}" -eq 60 ]; then
+        echo "ERROR: Xorg did not become ready."
+        exit 1
+    fi
+
+    sleep 1
+done
+
+echo
+echo "GPU:"
+nvidia-smi --query-gpu=name,driver_version --format=csv,noheader || true
+
+echo
+echo "Display:"
+xdpyinfo -display "${DISPLAY}" \
+    | grep -E 'dimensions:|resolution:' \
+    || true
+
+echo
+echo "Starting Sunshine..."
+echo
+
+exec /usr/bin/sunshine