When I run docker run -it --net=host -e DISPLAY=$DISPLAY <image>
and xhost +
on my host device, the gui applications in the docker container works well. However, when it comes to rootless dockerd (with env DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
when using docker cli), the gui applications do not work and prompts
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :0
So what is the difference between root and rootless docker container when connecting to the host display and how to use gui in rootless docker containers?