Dockerfile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # syntax=docker/dockerfile:1.7
  2. # ============================================================
  3. # Versions
  4. # ============================================================
  5. ARG SUNSHINE_VERSION=v2025.924.154138
  6. ARG NVIDIA_DRIVER_VERSION=580.126.20
  7. ARG NVIDIA_DRIVER_PACKAGE_VERSION=580.126.20-1ubuntu1
  8. # ============================================================
  9. # ============================================================
  10. # On récupère le paquet Sunshine depuis l'image officielle.
  11. FROM ghcr.io/lizardbyte/sunshine:${SUNSHINE_VERSION}-ubuntu-24.04 AS sunshine
  12. # PoC : on réutilise volontairement notre environnement graphique déjà validé.
  13. FROM image-registry.openshift-image-registry.svc:5000/desktop/desktop:latest
  14. # Import global ARGs into this build stage
  15. ARG NVIDIA_DRIVER_VERSION
  16. ARG NVIDIA_DRIVER_PACKAGE_VERSION
  17. USER root
  18. # L'image Sunshine officielle conserve le .deb utilisé pour installer Sunshine.
  19. COPY --from=sunshine /sunshine.deb /tmp/sunshine.deb
  20. RUN apt-get update \
  21. && apt-get install --no-install-recommends -y /tmp/sunshine.deb \
  22. && rm -f /tmp/sunshine.deb \
  23. && apt-get clean \
  24. && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
  25. COPY sunshine-entrypoint.sh /etc/sunshine-entrypoint.sh
  26. RUN sed -i 's/\r$//' /etc/sunshine-entrypoint.sh \
  27. && chmod 0755 /etc/sunshine-entrypoint.sh
  28. # Steam / Proton
  29. RUN dpkg --add-architecture i386 \
  30. && apt-get update \
  31. && apt-get install --no-install-recommends -y \
  32. ca-certificates \
  33. curl \
  34. && curl -fsSL \
  35. https://repo.steampowered.com/steam/archive/stable/steam.gpg \
  36. -o /usr/share/keyrings/steam.gpg \
  37. && printf '%s\n' \
  38. 'deb [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam' \
  39. > /etc/apt/sources.list.d/steam-bootstrap.list \
  40. && apt-get update \
  41. && apt-get install --no-install-recommends -y \
  42. steam-launcher \
  43. steam-libs-amd64 \
  44. steam-libs-i386 \
  45. libegl1:amd64 \
  46. libegl1:i386 \
  47. libgbm1:amd64 \
  48. libgbm1:i386 \
  49. libgl1:amd64 \
  50. libgl1:i386 \
  51. libgl1-mesa-dri:amd64 \
  52. libgl1-mesa-dri:i386 \
  53. libglx-mesa0:amd64 \
  54. libglx-mesa0:i386 \
  55. libvulkan1:amd64 \
  56. libvulkan1:i386 \
  57. && rm -f /etc/apt/sources.list.d/steam-bootstrap.list \
  58. && apt-get clean \
  59. && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
  60. # Stack 32bits Nvidia
  61. RUN curl -fsSLO \
  62. https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb \
  63. && dpkg -i cuda-keyring_1.1-1_all.deb \
  64. && rm -f cuda-keyring_1.1-1_all.deb \
  65. && dpkg --add-architecture i386 \
  66. && apt-get update \
  67. && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  68. libnvidia-common-580=${NVIDIA_DRIVER_PACKAGE_VERSION} \
  69. libnvidia-gpucomp-580:i386=${NVIDIA_DRIVER_PACKAGE_VERSION} \
  70. libnvidia-decode-580:i386=${NVIDIA_DRIVER_PACKAGE_VERSION} \
  71. libnvidia-compute-580:i386=${NVIDIA_DRIVER_PACKAGE_VERSION} \
  72. libnvidia-gl-580:i386=${NVIDIA_DRIVER_PACKAGE_VERSION} \
  73. && apt-get clean \
  74. && rm -rf /var/lib/apt/lists/*
  75. USER 1000:1000
  76. ENV DISPLAY=:20 \
  77. HOME=/home/ubuntu \
  78. USER=ubuntu \
  79. XDG_RUNTIME_DIR=/tmp/runtime-ubuntu \
  80. PIPEWIRE_RUNTIME_DIR=/tmp/runtime-ubuntu \
  81. PULSE_RUNTIME_PATH=/tmp/runtime-ubuntu/pulse \
  82. PULSE_SERVER=unix:/tmp/runtime-ubuntu/pulse/native \
  83. NVIDIA_VISIBLE_DEVICES=all \
  84. NVIDIA_DRIVER_CAPABILITIES=all
  85. WORKDIR /home/ubuntu
  86. EXPOSE 47984-47990/tcp
  87. EXPOSE 48010/tcp
  88. EXPOSE 47998-48000/udp
  89. ENTRYPOINT ["/etc/sunshine-entrypoint.sh"]