Not able to run rviz on ros docker
Hello,
I have created a dockerfile with ubuntu16, ros kinetic. I have been able to build the image and I am trying to run rviz on it but I get this error
root@bcec7cce1809:/opt/libglvnd# rviz
QXcbConnection: Could not connect to display :1
Aborted (core dumped)
I referred this tutorial (http://wiki.ros.org/docker/Tutorials/GUI) and this link (https://github.com/henry2423/docker-r...)
So, before running my docker I entered these command
$ XSOCK=/tmp/.X11-unix
$ XAUTH=/tmp/.docker.xauth
$ touch $XAUTH
$ xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
$ xhost +si:localuser:root
Then I run my built docker image as
sudo docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" pankhurivanjani/roskineticslam:v1 bash
Can anyone help me in figuring out if I am using something in the wrong way?
P.S. My local system has ubuntu 20 and ros noetic installed in it.