| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- # Ubuntu release versions 18.04 and 20.04 are supported
- ARG UBUNTU_RELEASE=20.04
- ARG CUDA_VERSION=11.2.2
- FROM nvcr.io/nvidia/cudagl:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_RELEASE}
- LABEL maintainer "https://github.com/ehfd,https://github.com/danisla"
- ARG UBUNTU_RELEASE
- ARG CUDA_VERSION
- # Make all NVIDIA GPUs visible, but we want to manually install drivers
- ARG NVIDIA_VISIBLE_DEVICES=all
- ARG DEBIAN_FRONTEND=noninteractive
- ENV NVIDIA_DRIVER_CAPABILITIES all
- ENV DISPLAY :0
- ENV PULSE_SERVER 127.0.0.1:4713
- ENV XDG_RUNTIME_DIR /tmp
- # Default environment variables (password is "mypasswd")
- ENV TZ UTC
- ENV SIZEW 1920
- ENV SIZEH 1080
- ENV REFRESH 60
- ENV DPI 96
- ENV CDEPTH 24
- ENV VIDEO_PORT DFP
- ENV PASSWD mypasswd
- ENV NOVNC_ENABLE false
- ENV WEBRTC_ENCODER nvh264enc
- ENV WEBRTC_ENABLE_RESIZE false
- ENV ENABLE_AUDIO true
- ENV ENABLE_BASIC_AUTH true
- # Install locales to prevent errors
- RUN apt-get clean && \
- apt-get update && apt-get install --no-install-recommends -y locales && \
- rm -rf /var/lib/apt/lists/* && \
- locale-gen en_US.UTF-8
- ENV LANG en_US.UTF-8
- ENV LANGUAGE en_US:en
- ENV LC_ALL en_US.UTF-8
- # Install Xorg, Xfce Desktop, and others
- RUN dpkg --add-architecture i386 && \
- apt-get update && apt-get install --no-install-recommends -y \
- software-properties-common \
- apt-transport-https \
- apt-utils \
- build-essential \
- ca-certificates \
- kmod \
- libc6:i386 \
- libc6-dev \
- cups-filters \
- cups-common \
- cups-pdf \
- curl \
- file \
- wget \
- bzip2 \
- gzip \
- p7zip-full \
- xz-utils \
- zip \
- unzip \
- zstd \
- gcc \
- git \
- jq \
- make \
- python3 \
- python3-cups \
- python3-numpy \
- mlocate \
- nano \
- vim \
- htop \
- firefox \
- transmission-gtk \
- qpdfview \
- xarchiver \
- brltty \
- brltty-x11 \
- desktop-file-utils \
- fonts-dejavu-core \
- fonts-freefont-ttf \
- fonts-noto \
- fonts-noto-cjk \
- fonts-noto-cjk-extra \
- fonts-noto-color-emoji \
- fonts-noto-hinted \
- fonts-noto-mono \
- fonts-opensymbol \
- fonts-symbola \
- fonts-ubuntu \
- gucharmap \
- mpd \
- onboard \
- parole \
- policykit-desktop-privileges \
- libpulse0 \
- pulseaudio \
- pavucontrol \
- ristretto \
- supervisor \
- thunar \
- thunar-volman \
- thunar-archive-plugin \
- thunar-media-tags-plugin \
- net-tools \
- libgtk-3-bin \
- libpci3 \
- libelf-dev \
- libglvnd-dev \
- vainfo \
- vdpauinfo \
- pkg-config \
- mesa-utils \
- mesa-utils-extra \
- libglu1 \
- libglu1:i386 \
- libsm6 \
- libxv1 \
- libxv1:i386 \
- libxtst6 \
- libxtst6:i386 \
- xdg-utils \
- x11-xkb-utils \
- x11-xserver-utils \
- x11-utils \
- x11-apps \
- dbus-x11 \
- libdbus-c++-1-0v5 \
- dmz-cursor-theme \
- numlockx \
- xauth \
- xcursor-themes \
- xinit \
- xfonts-base \
- xkb-data \
- libxrandr-dev \
- xorg \
- xubuntu-artwork \
- xfburn \
- xfpanel-switch \
- xfce4 \
- xfdesktop4 \
- xfwm4 \
- xfce4-appfinder \
- xfce4-clipman \
- xfce4-dict \
- xfce4-goodies \
- xfce4-notes \
- xfce4-notifyd \
- xfce4-panel \
- xfce4-screenshooter \
- xfce4-session \
- xfce4-settings \
- xfce4-taskmanager \
- xfce4-terminal \
- xfce4-appmenu-plugin \
- xfce4-battery-plugin \
- xfce4-clipman-plugin \
- xfce4-cpufreq-plugin \
- xfce4-cpugraph-plugin \
- xfce4-diskperf-plugin \
- xfce4-datetime-plugin \
- xfce4-fsguard-plugin \
- xfce4-genmon-plugin \
- xfce4-indicator-plugin \
- xfce4-mpc-plugin \
- xfce4-mount-plugin \
- xfce4-netload-plugin \
- xfce4-notes-plugin \
- xfce4-places-plugin \
- xfce4-pulseaudio-plugin \
- xfce4-sensors-plugin \
- xfce4-smartbookmark-plugin \
- xfce4-statusnotifier-plugin \
- xfce4-systemload-plugin \
- xfce4-timer-plugin \
- xfce4-verve-plugin \
- xfce4-weather-plugin \
- xfce4-whiskermenu-plugin \
- xfce4-xkb-plugin && \
- apt-get install -y libreoffice && \
- cp -rf /etc/xdg/xfce4/panel/default.xml /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml && \
- if [ "${UBUNTU_RELEASE}" = "18.04" ]; then apt-get install --no-install-recommends -y vulkan-utils; else apt-get install --no-install-recommends -y vulkan-tools; fi && \
- # Support libva and VA-API through NVIDIA VDPAU
- curl -fsSL -o /tmp/vdpau-va-driver.deb "https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev/+files/vdpau-va-driver_0.7.4-6ubuntu2~ppa1~18.04.1_amd64.deb" && apt-get install --no-install-recommends -y /tmp/vdpau-va-driver.deb && rm -rf /tmp/* && \
- rm -rf /var/lib/apt/lists/*
- # Wine, Winetricks, and PlayOnLinux, comment out the below lines to disable
- ARG WINE_BRANCH=devel
- RUN if [ "${UBUNTU_RELEASE}" = "18.04" ]; then add-apt-repository ppa:cybermax-dexter/sdl2-backport; fi && \
- curl -fsSL -o /usr/share/keyrings/winehq-archive.key "https://dl.winehq.org/wine-builds/winehq.key" && \
- curl -fsSL -o "/etc/apt/sources.list.d/winehq-$(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2).sources" "https://dl.winehq.org/wine-builds/ubuntu/dists/$(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2)/winehq-$(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2).sources" && \
- add-apt-repository ppa:lutris-team/lutris && \
- apt-get update && apt-get install --install-recommends -y \
- winehq-${WINE_BRANCH} && \
- apt-get update && apt-get install --no-install-recommends -y \
- lutris \
- q4wine \
- playonlinux && \
- rm -rf /var/lib/apt/lists/* && \
- curl -fsSL -o /usr/bin/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" && \
- chmod 755 /usr/bin/winetricks && \
- curl -fsSL -o /usr/share/bash-completion/completions/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion"
- # Install latest selkies-gstreamer (https://github.com/selkies-project/selkies-gstreamer) build, Python application, and web application
- RUN apt-get update && apt-get install --no-install-recommends -y \
- adwaita-icon-theme-full \
- build-essential \
- python3-pip \
- python3-dev \
- python3-gi \
- python3-setuptools \
- python3-wheel \
- tzdata \
- sudo \
- udev \
- xclip \
- x11-utils \
- xdotool \
- wmctrl \
- jq \
- gdebi-core \
- x11-xserver-utils \
- xserver-xorg-core \
- libopus0 \
- libgdk-pixbuf2.0-0 \
- libsrtp2-1 \
- libxdamage1 \
- libxml2-dev \
- libwebrtc-audio-processing1 \
- libcairo-gobject2 \
- pulseaudio \
- libpulse0 \
- libpangocairo-1.0-0 \
- libgirepository1.0-dev \
- libjpeg-dev \
- zlib1g-dev \
- x264 && \
- if [ "${UBUNTU_RELEASE}" \> "20.04" ]; then apt-get install --no-install-recommends -y xcvt; fi && \
- rm -rf /var/lib/apt/lists/* && \
- cd /opt && \
- SELKIES_VERSION=$(curl -fsSL "https://api.github.com/repos/selkies-project/selkies-gstreamer/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g') && \
- curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies-gstreamer-v${SELKIES_VERSION}-ubuntu${UBUNTU_RELEASE}.tgz" | tar -zxf - && \
- curl -O -fsSL "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" && \
- if [ "${UBUNTU_RELEASE}" \> "18.04" ]; then pip3 install -e "git+https://github.com/selkies-project/python-xlib.git@add-xfixes-cursor#egg=python-xlib"; fi && \
- curl -fsSL "https://github.com/selkies-project/selkies-gstreamer/releases/download/v${SELKIES_VERSION}/selkies-gstreamer-web-v${SELKIES_VERSION}.tgz" | tar -zxf - && \
- cd /usr/local/cuda/lib64 && sudo find . -maxdepth 1 -type l -name "*libnvrtc.so.*" -exec sh -c 'ln -sf $(basename {}) libnvrtc.so' \;
- # Install latest noVNC web interface for fallback
- RUN apt-get update && apt-get install --no-install-recommends -y \
- autoconf \
- automake \
- autotools-dev \
- chrpath \
- debhelper \
- git \
- jq \
- python3 \
- python3-numpy \
- libc6-dev \
- libcairo2-dev \
- libjpeg-turbo8-dev \
- libssl-dev \
- libv4l-dev \
- libvncserver-dev \
- libtool-bin \
- libxdamage-dev \
- libxinerama-dev \
- libxrandr-dev \
- libxss-dev \
- libxtst-dev \
- libavahi-client-dev && \
- rm -rf /var/lib/apt/lists/* && \
- git clone "https://github.com/LibVNC/x11vnc.git" /tmp/x11vnc && \
- cd /tmp/x11vnc && autoreconf -fi && ./configure && make install && cd / && rm -rf /tmp/* && \
- NOVNC_VERSION=$(curl -fsSL "https://api.github.com/repos/noVNC/noVNC/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g') && \
- curl -fsSL https://github.com/novnc/noVNC/archive/v${NOVNC_VERSION}.tar.gz | tar -xzf - -C /opt && \
- mv /opt/noVNC-${NOVNC_VERSION} /opt/noVNC && \
- ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html && \
- git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify
- # Add custom packages below this comment, or use FROM in a new container and replace entrypoint.sh or supervisord.conf
- # Create user with password ${PASSWD}
- RUN apt-get update && apt-get install --no-install-recommends -y \
- sudo && \
- rm -rf /var/lib/apt/lists/* && \
- groupadd -g 1000 user && \
- useradd -ms /bin/bash user -u 1000 -g 1000 && \
- usermod -a -G adm,audio,cdrom,dialout,dip,fax,floppy,input,lp,lpadmin,plugdev,scanner,sudo,tape,tty,video,voice user && \
- echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
- chown user:user /home/user && \
- echo "user:${PASSWD}" | chpasswd && \
- ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
- COPY entrypoint.sh /etc/entrypoint.sh
- RUN chmod 755 /etc/entrypoint.sh
- COPY selkies-gstreamer-entrypoint.sh /etc/selkies-gstreamer-entrypoint.sh
- RUN chmod 755 /etc/selkies-gstreamer-entrypoint.sh
- COPY supervisord.conf /etc/supervisord.conf
- RUN chmod 755 /etc/supervisord.conf
- EXPOSE 8080
- USER user
- ENV USER=user
- WORKDIR /home/user
- ENTRYPOINT ["/usr/bin/supervisord"]
|