Dockerfile 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. # This Source Code Form is subject to the terms of the Mozilla Public
  2. # License, v. 2.0. If a copy of the MPL was not distributed with this
  3. # file, You can obtain one at https://mozilla.org/MPL/2.0/.
  4. # Ubuntu release versions 22.04, and 20.04 are supported
  5. ARG DISTRIB_RELEASE=22.04
  6. FROM ubuntu:${DISTRIB_RELEASE}
  7. LABEL maintainer "https://github.com/ehfd,https://github.com/danisla"
  8. ARG DISTRIB_RELEASE
  9. # Use noninteractive mode to skip confirmation when installing packages
  10. ARG DEBIAN_FRONTEND=noninteractive
  11. # System defaults that should not be changed
  12. ENV DISPLAY :0
  13. ENV XDG_RUNTIME_DIR /tmp/runtime-user
  14. ENV PULSE_SERVER unix:/run/pulse/native
  15. # Install fundamental packages
  16. RUN apt-get clean && apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends -y \
  17. apt-transport-https \
  18. apt-utils \
  19. build-essential \
  20. ca-certificates \
  21. curl \
  22. gnupg \
  23. locales \
  24. make \
  25. software-properties-common \
  26. wget && \
  27. rm -rf /var/lib/apt/lists/* && \
  28. locale-gen en_US.UTF-8
  29. # Set locales
  30. ENV LANG en_US.UTF-8
  31. ENV LANGUAGE en_US:en
  32. ENV LC_ALL en_US.UTF-8
  33. # Install operating system libraries or packages
  34. RUN dpkg --add-architecture i386 && \
  35. apt-get update && apt-get install --no-install-recommends -y \
  36. alsa-base \
  37. alsa-utils \
  38. cups-browsed \
  39. cups-bsd \
  40. cups-common \
  41. cups-filters \
  42. printer-driver-cups-pdf \
  43. file \
  44. bzip2 \
  45. gzip \
  46. xz-utils \
  47. unar \
  48. rar \
  49. unrar \
  50. zip \
  51. unzip \
  52. zstd \
  53. gcc \
  54. git \
  55. jq \
  56. python3 \
  57. python3-cups \
  58. python3-numpy \
  59. ssl-cert \
  60. nano \
  61. vim \
  62. htop \
  63. fakeroot \
  64. fonts-dejavu \
  65. fonts-freefont-ttf \
  66. fonts-hack \
  67. fonts-liberation \
  68. fonts-noto \
  69. fonts-noto-cjk \
  70. fonts-noto-cjk-extra \
  71. fonts-noto-color-emoji \
  72. fonts-noto-extra \
  73. fonts-noto-ui-extra \
  74. fonts-noto-hinted \
  75. fonts-noto-mono \
  76. fonts-noto-unhinted \
  77. fonts-opensymbol \
  78. fonts-symbola \
  79. fonts-ubuntu \
  80. lame \
  81. less \
  82. libavcodec-extra \
  83. libpulse0 \
  84. pulseaudio \
  85. supervisor \
  86. net-tools \
  87. packagekit-tools \
  88. pkg-config \
  89. mesa-utils \
  90. va-driver-all \
  91. va-driver-all:i386 \
  92. i965-va-driver-shaders \
  93. i965-va-driver-shaders:i386 \
  94. intel-media-va-driver-non-free \
  95. intel-media-va-driver-non-free:i386 \
  96. libva2 \
  97. libva2:i386 \
  98. vainfo \
  99. vdpau-driver-all \
  100. vdpau-driver-all:i386 \
  101. vdpauinfo \
  102. mesa-vulkan-drivers \
  103. mesa-vulkan-drivers:i386 \
  104. libvulkan-dev \
  105. libvulkan-dev:i386 \
  106. vulkan-tools \
  107. ocl-icd-libopencl1 \
  108. clinfo \
  109. dbus-user-session \
  110. dbus-x11 \
  111. libdbus-c++-1-0v5 \
  112. xkb-data \
  113. xauth \
  114. xbitmaps \
  115. xdg-user-dirs \
  116. xdg-utils \
  117. xfonts-base \
  118. xfonts-scalable \
  119. xinit \
  120. xsettingsd \
  121. libxrandr-dev \
  122. x11-xkb-utils \
  123. x11-xserver-utils \
  124. x11-utils \
  125. x11-apps \
  126. xserver-xorg-input-all \
  127. xserver-xorg-input-wacom \
  128. xserver-xorg-video-all \
  129. xserver-xorg-video-intel \
  130. xserver-xorg-video-qxl \
  131. # Install OpenGL libraries
  132. libxau6 \
  133. libxau6:i386 \
  134. libxdmcp6 \
  135. libxdmcp6:i386 \
  136. libxcb1 \
  137. libxcb1:i386 \
  138. libxext6 \
  139. libxext6:i386 \
  140. libx11-6 \
  141. libx11-6:i386 \
  142. libxv1 \
  143. libxv1:i386 \
  144. libxtst6 \
  145. libxtst6:i386 \
  146. libglvnd0 \
  147. libglvnd0:i386 \
  148. libgl1 \
  149. libgl1:i386 \
  150. libglx0 \
  151. libglx0:i386 \
  152. libegl1 \
  153. libegl1:i386 \
  154. libgles2 \
  155. libgles2:i386 \
  156. libglu1 \
  157. libglu1:i386 \
  158. libsm6 \
  159. libsm6:i386 && \
  160. rm -rf /var/lib/apt/lists/* && \
  161. echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
  162. echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf && \
  163. # Configure OpenCL manually
  164. mkdir -pm755 /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd && \
  165. # Configure Vulkan manually
  166. VULKAN_API_VERSION=$(dpkg -s libvulkan1 | grep -oP 'Version: [0-9|\.]+' | grep -oP '[0-9]+(\.[0-9]+)(\.[0-9]+)') && \
  167. mkdir -pm755 /etc/vulkan/icd.d/ && echo "{\n\
  168. \"file_format_version\" : \"1.0.0\",\n\
  169. \"ICD\": {\n\
  170. \"library_path\": \"libGLX_nvidia.so.0\",\n\
  171. \"api_version\" : \"${VULKAN_API_VERSION}\"\n\
  172. }\n\
  173. }" > /etc/vulkan/icd.d/nvidia_icd.json && \
  174. # Configure EGL manually
  175. mkdir -pm755 /usr/share/glvnd/egl_vendor.d/ && echo "{\n\
  176. \"file_format_version\" : \"1.0.0\",\n\
  177. \"ICD\": {\n\
  178. \"library_path\": \"libEGL_nvidia.so.0\"\n\
  179. }\n\
  180. }" > /usr/share/glvnd/egl_vendor.d/10_nvidia.json
  181. # Expose NVIDIA libraries and paths
  182. ENV PATH /usr/local/nvidia/bin:${PATH}
  183. ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
  184. # Make all NVIDIA GPUs visible by default
  185. ENV NVIDIA_VISIBLE_DEVICES all
  186. # All NVIDIA driver capabilities should preferably be used, check `NVIDIA_DRIVER_CAPABILITIES` inside the container if things do not work
  187. ENV NVIDIA_DRIVER_CAPABILITIES all
  188. # Disable VSYNC for NVIDIA GPUs
  189. ENV __GL_SYNC_TO_VBLANK 0
  190. # Anything above this line should always be kept the same between docker-nvidia-glx-desktop and docker-nvidia-egl-desktop
  191. # Default environment variables (password is "mypasswd")
  192. ENV TZ UTC
  193. ENV SIZEW 1920
  194. ENV SIZEH 1080
  195. ENV REFRESH 60
  196. ENV DPI 96
  197. ENV CDEPTH 24
  198. ENV VIDEO_PORT DFP
  199. ENV PASSWD mypasswd
  200. ENV NOVNC_ENABLE false
  201. ENV WEBRTC_ENCODER nvh264enc
  202. ENV WEBRTC_ENABLE_RESIZE false
  203. ENV ENABLE_BASIC_AUTH true
  204. # Set versions for components that should be manually checked before upgrading, other component versions are automatically determined by fetching the version online
  205. ARG NOVNC_VERSION=1.4.0
  206. # Install Xorg and NVIDIA driver installer dependencies
  207. RUN apt-get update && apt-get install --no-install-recommends -y \
  208. kmod \
  209. libc6-dev \
  210. libc6:i386 \
  211. libpci3 \
  212. libelf-dev \
  213. pkg-config \
  214. xorg && \
  215. rm -rf /var/lib/apt/lists/*
  216. # Anything below this line should always be kept the same between docker-nvidia-glx-desktop and docker-nvidia-egl-desktop
  217. # Install KDE and other GUI packages
  218. ENV XDG_CURRENT_DESKTOP KDE
  219. ENV XDG_SESSION_DESKTOP KDE
  220. ENV XDG_SESSION_TYPE x11
  221. ENV DESKTOP_SESSION plasma
  222. ENV KDE_FULL_SESSION true
  223. ENV KWIN_COMPOSE N
  224. ENV KWIN_X11_NO_SYNC_TO_VBLANK 1
  225. # Use sudoedit to change protected files instead of using sudo on kate
  226. ENV SUDO_EDITOR kate
  227. # Set input to fcitx
  228. ENV GTK_IM_MODULE fcitx
  229. ENV QT_IM_MODULE fcitx
  230. ENV XIM fcitx
  231. ENV XMODIFIERS "@im=fcitx"
  232. # Enable AppImage execution in containers
  233. ENV APPIMAGE_EXTRACT_AND_RUN 1
  234. RUN mkdir -pm755 /etc/apt/preferences.d && echo "Package: firefox*\n\
  235. Pin: version 1:1snap*\n\
  236. Pin-Priority: -1" > /etc/apt/preferences.d/firefox-nosnap && \
  237. mkdir -pm755 /etc/apt/trusted.gpg.d && curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0AB215679C571D1C8325275B9BDB3D89CE49EC21" | gpg --dearmor -o /etc/apt/trusted.gpg.d/mozillateam-ubuntu-ppa.gpg && \
  238. mkdir -pm755 /etc/apt/sources.list.d && echo "deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu $(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"') main" > "/etc/apt/sources.list.d/mozillateam-ubuntu-ppa-$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"').list" && \
  239. apt-get update && apt-get install --no-install-recommends -y \
  240. kde-plasma-desktop \
  241. adwaita-icon-theme-full \
  242. appmenu-gtk3-module \
  243. ark \
  244. aspell \
  245. aspell-en \
  246. breeze \
  247. breeze-cursor-theme \
  248. breeze-gtk-theme \
  249. breeze-icon-theme \
  250. debconf-kde-helper \
  251. desktop-file-utils \
  252. dolphin \
  253. dolphin-plugins \
  254. dbus-x11 \
  255. enchant-2 \
  256. fcitx \
  257. fcitx-frontend-gtk2 \
  258. fcitx-frontend-gtk3 \
  259. fcitx-frontend-qt5 \
  260. fcitx-module-dbus \
  261. fcitx-module-kimpanel \
  262. fcitx-module-lua \
  263. fcitx-module-x11 \
  264. fcitx-tools \
  265. fcitx-hangul \
  266. fcitx-libpinyin \
  267. fcitx-m17n \
  268. fcitx-mozc \
  269. fcitx-sayura \
  270. fcitx-unikey \
  271. filelight \
  272. frameworkintegration \
  273. gwenview \
  274. haveged \
  275. hunspell \
  276. im-config \
  277. kate \
  278. kcalc \
  279. kcharselect \
  280. kdeadmin \
  281. kde-config-fcitx \
  282. kde-config-gtk-style \
  283. kde-config-gtk-style-preview \
  284. kdeconnect \
  285. kdegraphics-thumbnailers \
  286. kde-spectacle \
  287. kdf \
  288. kdialog \
  289. kget \
  290. kimageformat-plugins \
  291. kinfocenter \
  292. kio \
  293. kio-extras \
  294. kmag \
  295. kmenuedit \
  296. kmix \
  297. kmousetool \
  298. kmouth \
  299. ksshaskpass \
  300. ktimer \
  301. kwayland-integration \
  302. kwin-addons \
  303. kwin-x11 \
  304. libdbusmenu-glib4 \
  305. libdbusmenu-gtk3-4 \
  306. libgail-common \
  307. libgdk-pixbuf2.0-bin \
  308. libgtk2.0-bin \
  309. libgtk-3-bin \
  310. libkf5baloowidgets-bin \
  311. libkf5dbusaddons-bin \
  312. libkf5iconthemes-bin \
  313. libkf5kdelibs4support5-bin \
  314. libkf5khtml-bin \
  315. libkf5parts-plugins \
  316. libqt5multimedia5-plugins \
  317. librsvg2-common \
  318. media-player-info \
  319. okular \
  320. okular-extra-backends \
  321. partitionmanager \
  322. plasma-browser-integration \
  323. plasma-calendar-addons \
  324. plasma-dataengines-addons \
  325. plasma-discover \
  326. plasma-integration \
  327. plasma-runners-addons \
  328. plasma-widgets-addons \
  329. policykit-desktop-privileges \
  330. polkit-kde-agent-1 \
  331. print-manager \
  332. qapt-deb-installer \
  333. qml-module-org-kde-runnermodel \
  334. qml-module-org-kde-qqc2desktopstyle \
  335. qml-module-qtgraphicaleffects \
  336. qml-module-qtquick-xmllistmodel \
  337. qt5-gtk-platformtheme \
  338. qt5-image-formats-plugins \
  339. qt5-style-plugins \
  340. qtspeech5-flite-plugin \
  341. qtvirtualkeyboard-plugin \
  342. software-properties-qt \
  343. sonnet-plugins \
  344. sweeper \
  345. systemsettings \
  346. ubuntu-drivers-common \
  347. vlc \
  348. vlc-l10n \
  349. vlc-plugin-access-extra \
  350. vlc-plugin-notify \
  351. vlc-plugin-samba \
  352. vlc-plugin-skins2 \
  353. vlc-plugin-video-splitter \
  354. vlc-plugin-visualization \
  355. xdg-desktop-portal-kde \
  356. xdg-user-dirs \
  357. firefox \
  358. pavucontrol-qt \
  359. transmission-qt && \
  360. apt-get install --install-recommends -y \
  361. libreoffice \
  362. libreoffice-kf5 \
  363. libreoffice-plasma \
  364. libreoffice-style-breeze && \
  365. rm -rf /var/lib/apt/lists/* && \
  366. # Fix KDE startup permissions issues in containers
  367. MULTI_ARCH=$(dpkg --print-architecture | sed -e 's/arm64/aarch64-linux-gnu/' -e 's/armhf/arm-linux-gnueabihf/' -e 's/riscv64/riscv64-linux-gnu/' -e 's/ppc64el/powerpc64le-linux-gnu/' -e 's/s390x/s390x-linux-gnu/' -e 's/i.*86/i386-linux-gnu/' -e 's/amd64/x86_64-linux-gnu/' -e 's/unknown/x86_64-linux-gnu/') && \
  368. cp -f /usr/lib/${MULTI_ARCH}/libexec/kf5/start_kdeinit /tmp/ && \
  369. rm -f /usr/lib/${MULTI_ARCH}/libexec/kf5/start_kdeinit && \
  370. cp -f /tmp/start_kdeinit /usr/lib/${MULTI_ARCH}/libexec/kf5/start_kdeinit && \
  371. rm -f /tmp/start_kdeinit && \
  372. # KDE disable screen lock, double-click to open instead of single-click
  373. echo "[Daemon]\n\
  374. Autolock=false\n\
  375. LockOnResume=false" > /etc/xdg/kscreenlockerrc && \
  376. echo "[KDE]\n\
  377. SingleClick=false\n\
  378. \n\
  379. [KDE Action Restrictions]\n\
  380. action/lock_screen=false\n\
  381. logout=false" > /etc/xdg/kdeglobals
  382. # Wine, Winetricks, Lutris, and PlayOnLinux, this process must be consistent with https://wiki.winehq.org/Ubuntu
  383. ARG WINE_BRANCH=staging
  384. RUN mkdir -pm755 /etc/apt/keyrings && curl -fsSL -o /etc/apt/keyrings/winehq-archive.key "https://dl.winehq.org/wine-builds/winehq.key" && \
  385. curl -fsSL -o "/etc/apt/sources.list.d/winehq-$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"').sources" "https://dl.winehq.org/wine-builds/ubuntu/dists/$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"')/winehq-$(grep UBUNTU_CODENAME= /etc/os-release | cut -d= -f2 | tr -d '\"').sources" && \
  386. apt-get update && apt-get install --install-recommends -y \
  387. winehq-${WINE_BRANCH} && \
  388. apt-get install --no-install-recommends -y \
  389. q4wine \
  390. playonlinux && \
  391. LUTRIS_VERSION="$(curl -fsSL "https://api.github.com/repos/lutris/lutris/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')" && \
  392. curl -fsSL -O "https://github.com/lutris/lutris/releases/download/v${LUTRIS_VERSION}/lutris_${LUTRIS_VERSION}_all.deb" && \
  393. apt-get install --no-install-recommends -y ./lutris_${LUTRIS_VERSION}_all.deb && rm -f "./lutris_${LUTRIS_VERSION}_all.deb" && \
  394. rm -rf /var/lib/apt/lists/* && \
  395. curl -fsSL -o /usr/bin/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" && \
  396. chmod 755 /usr/bin/winetricks && \
  397. curl -fsSL -o /usr/share/bash-completion/completions/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion"
  398. # Install latest Selkies-GStreamer (https://github.com/selkies-project/selkies-gstreamer) build, Python application, and web application, should be consistent with selkies-gstreamer documentation
  399. RUN apt-get update && apt-get install --no-install-recommends -y \
  400. # GStreamer dependencies
  401. python3-pip \
  402. python3-dev \
  403. python3-gi \
  404. python3-setuptools \
  405. python3-wheel \
  406. udev \
  407. wmctrl \
  408. jq \
  409. gdebi-core \
  410. libgdk-pixbuf2.0-0 \
  411. libgtk2.0-bin \
  412. libgl-dev \
  413. libgles-dev \
  414. libglvnd-dev \
  415. libgudev-1.0-0 \
  416. xclip \
  417. x11-utils \
  418. xdotool \
  419. x11-xserver-utils \
  420. xserver-xorg-core \
  421. wayland-protocols \
  422. libwayland-dev \
  423. libwayland-egl1 \
  424. libx11-xcb1 \
  425. libxkbcommon0 \
  426. libxdamage1 \
  427. libsoup2.4-1 \
  428. libsoup-gnome2.4-1 \
  429. libsrtp2-1 \
  430. lame \
  431. libopus0 \
  432. libwebrtc-audio-processing1 \
  433. pulseaudio \
  434. libpulse0 \
  435. libcairo-gobject2 \
  436. libpangocairo-1.0-0 \
  437. libgirepository-1.0-1 \
  438. libopenjp2-7 \
  439. libjpeg-dev \
  440. libwebp-dev \
  441. libvpx-dev \
  442. zlib1g-dev \
  443. x264 \
  444. # AMD/Intel graphics driver dependencies
  445. va-driver-all \
  446. i965-va-driver-shaders \
  447. intel-media-va-driver-non-free \
  448. libva2 \
  449. vainfo \
  450. intel-gpu-tools \
  451. radeontop && \
  452. if [ "$(grep VERSION_ID= /etc/os-release | cut -d= -f2 | tr -d '\"')" \> "20.04" ]; then apt-get install --no-install-recommends -y xcvt; else apt-get install --no-install-recommends -y mesa-utils-extra; fi && \
  453. rm -rf /var/lib/apt/lists/* && \
  454. # Automatically fetch the latest selkies-gstreamer version and install the components
  455. SELKIES_VERSION="1.5.2" && \
  456. cd /opt && curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies-gstreamer-v${SELKIES_VERSION}-ubuntu$(grep VERSION_ID= /etc/os-release | cut -d= -f2 | tr -d '\"').tgz" | tar -zxf - && \
  457. # Extract NVRTC dependency, https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/LICENSE.txt
  458. NVRTC_VERSION="11.4.152" && \
  459. NVRTC_ARCH="$(dpkg --print-architecture | sed -e 's/arm64/sbsa/' -e 's/ppc64el/ppc64le/' -e 's/i.*86/x86/' -e 's/amd64/x86_64/' -e 's/unknown/x86_64/')" && \
  460. cd /tmp && curl -fsSL "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/linux-${NVRTC_ARCH}/cuda_nvrtc-linux-${NVRTC_ARCH}-${NVRTC_VERSION}-archive.tar.xz" | tar -xJf - -C /tmp && mv -f cuda_nvrtc* cuda_nvrtc && cd cuda_nvrtc/lib && chmod 755 libnvrtc* && mv -f libnvrtc* /opt/gstreamer/lib/$(dpkg --print-architecture | sed -e 's/arm64/aarch64-linux-gnu/' -e 's/armhf/arm-linux-gnueabihf/' -e 's/riscv64/riscv64-linux-gnu/' -e 's/ppc64el/powerpc64le-linux-gnu/' -e 's/s390x/s390x-linux-gnu/' -e 's/i.*86/i386-linux-gnu/' -e 's/amd64/x86_64-linux-gnu/' -e 's/unknown/x86_64-linux-gnu/')/ && cd /tmp && rm -rf /tmp/cuda_nvrtc && \
  461. cd /tmp && curl -fsSL -O "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl" && pip3 install "selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl" && rm -f "selkies_gstreamer-${SELKIES_VERSION}-py3-none-any.whl" && \
  462. cd /opt && curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies-gstreamer-web-v${SELKIES_VERSION}.tgz" | tar -zxf - && \
  463. cd /tmp && curl -fsSL -o selkies-js-interposer.deb "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies-js-interposer-v${SELKIES_VERSION}-ubuntu$(grep VERSION_ID= /etc/os-release | cut -d= -f2 | tr -d '\"').deb" && apt-get update && apt-get install --no-install-recommends -y ./selkies-js-interposer.deb && rm -f ./selkies-js-interposer.deb && rm -rf /var/lib/apt/lists/* /tmp/*
  464. # Add configuration for Selkies-GStreamer Joystick interposer
  465. ENV LD_PRELOAD /usr/local/lib/selkies-js-interposer/joystick_interposer.so${LD_PRELOAD:+:${LD_PRELOAD}}
  466. ENV SDL_JOYSTICK_DEVICE /dev/input/js0
  467. # Install the noVNC web interface and the latest x11vnc for fallback
  468. RUN apt-get update && apt-get install --no-install-recommends -y \
  469. autoconf \
  470. automake \
  471. autotools-dev \
  472. chrpath \
  473. debhelper \
  474. git \
  475. jq \
  476. python3 \
  477. python3-numpy \
  478. libc6-dev \
  479. libcairo2-dev \
  480. libjpeg-turbo8-dev \
  481. libssl-dev \
  482. libv4l-dev \
  483. libvncserver-dev \
  484. libtool-bin \
  485. libxdamage-dev \
  486. libxinerama-dev \
  487. libxrandr-dev \
  488. libxss-dev \
  489. libxtst-dev \
  490. libavahi-client-dev && \
  491. rm -rf /var/lib/apt/lists/* && \
  492. # Build the latest x11vnc source to avoid various errors
  493. git clone "https://github.com/LibVNC/x11vnc.git" /tmp/x11vnc && \
  494. cd /tmp/x11vnc && autoreconf -fi && ./configure && make install && cd / && rm -rf /tmp/* && \
  495. curl -fsSL "https://github.com/novnc/noVNC/archive/v${NOVNC_VERSION}.tar.gz" | tar -xzf - -C /opt && \
  496. mv -f "/opt/noVNC-${NOVNC_VERSION}" /opt/noVNC && \
  497. cd /opt/noVNC && ln -snf vnc.html index.html && \
  498. # Use the latest Websockify source to expose noVNC
  499. git clone "https://github.com/novnc/websockify.git" /opt/noVNC/utils/websockify
  500. # Add custom packages right below this comment, or use FROM in a new container and replace entrypoint.sh or supervisord.conf, and set ENTRYPOINT to /usr/bin/supervisord
  501. # Create user with password ${PASSWD} and assign adequate groups
  502. RUN apt-get update && apt-get install --no-install-recommends -y \
  503. sudo \
  504. tzdata && \
  505. rm -rf /var/lib/apt/lists/* && \
  506. groupadd -g 1000 user && \
  507. useradd -ms /bin/bash user -u 1000 -g 1000 && \
  508. usermod -a -G adm,audio,cdrom,dialout,dip,fax,floppy,input,lp,lpadmin,plugdev,pulse-access,render,scanner,ssl-cert,sudo,tape,tty,video,voice user && \
  509. echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
  510. chown user:user /home/user && \
  511. echo "user:${PASSWD}" | chpasswd && \
  512. ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
  513. # Copy scripts and configurations used to start the container
  514. COPY entrypoint.sh /etc/entrypoint.sh
  515. RUN chmod 755 /etc/entrypoint.sh
  516. COPY selkies-gstreamer-entrypoint.sh /etc/selkies-gstreamer-entrypoint.sh
  517. RUN chmod 755 /etc/selkies-gstreamer-entrypoint.sh
  518. COPY supervisord.conf /etc/supervisord.conf
  519. RUN chmod 755 /etc/supervisord.conf
  520. EXPOSE 8080
  521. USER 1000
  522. ENV SHELL /bin/bash
  523. ENV USER user
  524. WORKDIR /home/user
  525. ENTRYPOINT ["/usr/bin/supervisord"]