Hello to everyone.
On a real installation of Ubuntu I have written this Dockerfile (where it works perfectly) :
FROM nvidia/cudagl:11.3.0-base-ubuntu20.04
# Enviroment variables
ENV HOME /home/developer
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PATH "/bin:/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
ENV HW="GPU"
RUN apt-get update && apt-get install -y ntp curl apt-utils wget libopenexr-dev bzip2 build-essential zlib1g-dev libxmu-dev libxi-dev libxxf86vm-dev libfontconfig1 libxrender1 libgl1-mesa-glx xz-utils firefox default-jdk python3-numpy xvfb thunar mousepad
RUN service ntp restart
# We need the following command to make sure to access /dev/snd/*
RUN echo "pcm.!default { type plug slave.pcm "null" }" >> etc/asound.conf
RUN usermod -aG audio root
# Download & run Sikulix
RUN wget https://launchpad.net/sikuli/sikulix/2.0.5/+download/sikulixide-2.0.5.jar -O /tmp/sikulix.jar -q && \
chmod +x /tmp/sikulix.jar && \
echo 'Installing sikulix' && \
cp /tmp/sikulix.jar /usr/local/bin
RUN chmod +x /usr/local/bin/sikulix.jar && \
mkdir -p /home/developer && \
echo "developer:x:1000:1000:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:1000:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d && \
chmod 0440 /etc/sudoers.d && \
chown developer:developer -R /home/developer
# Run Sikulix in background mode
RUN echo "java -jar /usr/local/bin/sikulix.jar </dev/null &>/dev/null &" >> /home/developer/sikulix
RUN chmod +x /home/developer/sikulix
# Create shared folder inside the container
RUN mkdir /home/developer/shared-host
# Set the working directory / normal user
USER developer
WORKDIR /home/developer
I run the container with this script :
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run \
--gpus all \
--rm -it \
-v $XSOCK:$XSOCK:rw \
-v $XAUTH:$XAUTH:rw \
-e DISPLAY=$DISPLAY \
-e XAUTHORITY=$XAUTH \
-v /usr/share/firefox:/home/developer/ubuntu-host \
-t firefox/docker
The goal of this container is to display the GUI of sikulix and also to give NVIDIA GPU support for the container. Under WSL2 it works,but not perfectly. Infact when I run it,I see this error message :
#./start.sh
xauth: (argv):1: unable to read any entries from file “(stdin)”
do you know where could be the mistake ? can u help me to fix it ?