|
@@ -1,6 +1,5 @@
|
|
|
FROM ubuntu:20.04
|
|
FROM ubuntu:20.04
|
|
|
|
|
|
|
|
-# Based on https://github.com/ryought/glx-docker-headless-gpu/blob/master/Dockerfile
|
|
|
|
|
LABEL maintainer "https://github.com/ehfd"
|
|
LABEL maintainer "https://github.com/ehfd"
|
|
|
|
|
|
|
|
# Make all NVIDIA GPUS visible, but we want to manually install drivers
|
|
# Make all NVIDIA GPUS visible, but we want to manually install drivers
|
|
@@ -13,6 +12,7 @@ ENV NVIDIA_DRIVER_CAPABILITIES all
|
|
|
ENV VNCPASS vncpasswd
|
|
ENV VNCPASS vncpasswd
|
|
|
ENV SIZEW 1920
|
|
ENV SIZEW 1920
|
|
|
ENV SIZEH 1080
|
|
ENV SIZEH 1080
|
|
|
|
|
+ENV CDEPTH 24
|
|
|
|
|
|
|
|
# Install locales to prevent errors
|
|
# Install locales to prevent errors
|
|
|
RUN apt-get clean && \
|
|
RUN apt-get clean && \
|
|
@@ -24,9 +24,9 @@ ENV LANG en_US.UTF-8
|
|
|
ENV LANGUAGE en_US:en
|
|
ENV LANGUAGE en_US:en
|
|
|
ENV LC_ALL en_US.UTF-8
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
|
|
|
|
-# Almost same as nvidia/driver https://gitlab.com/nvidia/container-images/driver/-/blob/master/ubuntu20.04/Dockerfile
|
|
|
|
|
|
|
+# https://gitlab.com/nvidia/container-images/driver/-/blob/master/ubuntu20.04/Dockerfile
|
|
|
RUN dpkg --add-architecture i386 && \
|
|
RUN dpkg --add-architecture i386 && \
|
|
|
- apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
+ apt-get update && apt-get install -o APT::Immediate-Configure=false -y --no-install-recommends \
|
|
|
apt-utils \
|
|
apt-utils \
|
|
|
build-essential \
|
|
build-essential \
|
|
|
ca-certificates \
|
|
ca-certificates \
|
|
@@ -39,7 +39,7 @@ RUN dpkg --add-architecture i386 && \
|
|
|
pkg-config && \
|
|
pkg-config && \
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
-# Install X server and desktop before driver
|
|
|
|
|
|
|
+# Install Xorg and desktop packages
|
|
|
RUN apt-get update && apt-get install -y \
|
|
RUN apt-get update && apt-get install -y \
|
|
|
software-properties-common \
|
|
software-properties-common \
|
|
|
wget \
|
|
wget \
|
|
@@ -75,39 +75,7 @@ RUN apt-get update && apt-get install -y \
|
|
|
supervisor \
|
|
supervisor \
|
|
|
net-tools \
|
|
net-tools \
|
|
|
ubuntu-mate-core \
|
|
ubuntu-mate-core \
|
|
|
- ubuntu-mate-desktop && \
|
|
|
|
|
- rm -rf /var/lib/apt/lists/*
|
|
|
|
|
-
|
|
|
|
|
-# Install NVIDIA drivers, including X graphic drivers by omitting --x-{prefix,module-path,library-path,sysconfig-path}
|
|
|
|
|
-# Driver version must be equal to the host
|
|
|
|
|
-#ARG BASE_URL=https://us.download.nvidia.com/tesla
|
|
|
|
|
-ARG BASE_URL=http://us.download.nvidia.com/XFree86/Linux-x86_64
|
|
|
|
|
-ENV DRIVER_VERSION 460.39
|
|
|
|
|
-RUN cd /tmp && \
|
|
|
|
|
- curl -fSsl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run && \
|
|
|
|
|
- sh NVIDIA-Linux-x86_64-$DRIVER_VERSION.run -x && \
|
|
|
|
|
- cd NVIDIA-Linux-x86_64-$DRIVER_VERSION* && \
|
|
|
|
|
- ./nvidia-installer --silent \
|
|
|
|
|
- --no-kernel-module \
|
|
|
|
|
- --install-compat32-libs \
|
|
|
|
|
- --no-nouveau-check \
|
|
|
|
|
- --no-nvidia-modprobe \
|
|
|
|
|
- --no-rpms \
|
|
|
|
|
- --no-backup \
|
|
|
|
|
- --no-check-for-alternate-installs \
|
|
|
|
|
- --no-libglx-indirect \
|
|
|
|
|
- --no-install-libglvnd && \
|
|
|
|
|
- mkdir -p /usr/src/nvidia-$DRIVER_VERSION && \
|
|
|
|
|
- mv LICENSE mkprecompiled kernel /usr/src/nvidia-$DRIVER_VERSION && \
|
|
|
|
|
- sed '9,${/^\(kernel\|LICENSE\)/!d}' .manifest > /usr/src/nvidia-$DRIVER_VERSION/.manifest && \
|
|
|
|
|
- rm -rf /tmp/*
|
|
|
|
|
-
|
|
|
|
|
-# Install packages related to X server
|
|
|
|
|
-# pkg-config: nvidia-xconfig requires this package
|
|
|
|
|
-# mesa-utils: This package includes glxgears and glxinfo, which is useful for testing GLX drivers
|
|
|
|
|
-# x11vnc: Make connection between X11 server and VNC client.
|
|
|
|
|
-# x11-apps: xeyes can be used to make sure that X11 server is running.
|
|
|
|
|
-RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
+ ubuntu-mate-desktop \
|
|
|
mesa-utils \
|
|
mesa-utils \
|
|
|
x11vnc \
|
|
x11vnc \
|
|
|
x11-apps && \
|
|
x11-apps && \
|
|
@@ -125,7 +93,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
cd vkdevicechooser && \
|
|
cd vkdevicechooser && \
|
|
|
meson builddir --prefix=/usr && \
|
|
meson builddir --prefix=/usr && \
|
|
|
meson install -C builddir && \
|
|
meson install -C builddir && \
|
|
|
- cd / && rm -rf /tmp/*
|
|
|
|
|
|
|
+ rm -rf /tmp/*
|
|
|
|
|
|
|
|
# Sound driver including PulseAudio and GTK library
|
|
# Sound driver including PulseAudio and GTK library
|
|
|
# If you want to use sounds on docker, try 'pulseaudio --start'
|
|
# If you want to use sounds on docker, try 'pulseaudio --start'
|
|
@@ -136,22 +104,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# noVNC and Websockify
|
|
# noVNC and Websockify
|
|
|
-ENV NOVNC_VERSION 1.1.0
|
|
|
|
|
-RUN wget https://github.com/novnc/noVNC/archive/v$NOVNC_VERSION.zip && \
|
|
|
|
|
- unzip -q v$NOVNC_VERSION.zip && \
|
|
|
|
|
- rm -rf v$NOVNC_VERSION.zip && \
|
|
|
|
|
- mv noVNC-$NOVNC_VERSION /opt/noVNC && \
|
|
|
|
|
|
|
+ENV NOVNC_VERSION 1.2.0
|
|
|
|
|
+RUN 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 && \
|
|
ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html && \
|
|
|
git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify
|
|
git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify
|
|
|
|
|
|
|
|
-# X server segfault error mitigation
|
|
|
|
|
|
|
+# Xorg segfault error mitigation
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
dbus-x11 \
|
|
dbus-x11 \
|
|
|
libdbus-c++-1-0v5 && \
|
|
libdbus-c++-1-0v5 && \
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
-RUN sed -i "s/allowed_users=console/allowed_users=anybody/;$ a needs_root_rights=yes" /etc/X11/Xwrapper.config
|
|
|
|
|
-
|
|
|
|
|
# Create user with password ${VNCPASS}
|
|
# Create user with password ${VNCPASS}
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
sudo && \
|
|
sudo && \
|