I have developed a PyQt6,sqlalchemy application that I want to distribute as a docker container. I am new to docker thus before going on, I prefer to go step by step. The first step is learning how to run a X server in docker. I am starting from this example. I followed the example but I meet some trouble arriving at the docker run command
Here is what I tried first:
docker run -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth:rw -e XAUTHORITY=/tmp/.docker.xauth -t nautilus-ubuntu
and the response I get:
docker: Error response from daemon: error while creating mount source path '/host_mnt/tmp/.docker.xauth': mkdir /host_mnt/tmp/.docker.xauth: file exists. ERRO[0000] error waiting for container:
I read somewhere that it is best for newbie to use --mount instead of -v. Thus I modified my command like this:
docker run -e DISPLAY=unix$DISPLAY --mount type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix --mount type=bind,source=/tmp/.docker.xauth,target=/tmp/.docker.xauth:rw -e XAUTHORITY=/tmp/.docker.xauth -t nautilus-ubuntu
and I get an other error:
docker: Error response from daemon: invalid mount config for type "bind": stat /host_mnt/tmp/.docker.xauth: input/output error.
Could somebody help me fixing this ? My OS is Fedora 38.