Dockerfile 20 KB

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