I've been trying to get the following to work without success:
Dockerfile
FROM ubuntu:latest
#To install without any interactive dialogue
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
# Installing Nautilus File Manager
RUN apt-get install nautilus -y
CMD ["nautilus"]
Then running with:
sudo docker build -t nautilus-ubuntu .
sudo docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix nautilus-ubuntu
The error that I am getting is:
Unable to init server: Could not connect: Connection refused
This seems to have been asked heavily before but I've been trying for an hour all I could come across and there's nothing other than xhost + (which is insecure and I don't want to use) that can make this work.
One thing to note is that I am trying to get this to work in a way that I can build it and launch the target GUI app immediately, without having to log in to a bash session and do further things.