Blog Link :- https://parth2458.medium.com/launching-gui-app-jupyter-on-top-of-docker-container-1fe10dc2b62c
docker build -t IMAGE_NAME eg. centosgui
docker run --net=host --env="DISPLAY" --name CONTAINER_NAME centosgui
make sure you provide --net=host and -env="DISPLAY" to run.