Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

user interface - Running graphical applications on docker

I have been trying to run graphical applications (rviz, rqt_graph, etc) from inside a docker container. To do this I have found this excelent article:Rviz on docker

To summarize, the author says that we need to

  • call xhost +local:docker

  • use

         --env=DISPLAY 
         --env=QT_X11_NO_MITSHM=1 
         -v /tmp/.X11-unix:/tmp/.X11-unix 
    

when we run the container.

However if you see at the attached github page and you check the run_ssh_rviz_c.bash script you find

#!/bin/bash

docker run -it --rm --privileged 
           --net=host 
           --env=NVIDIA_VISIBLE_DEVICES=all 
           --env=NVIDIA_DRIVER_CAPABILITIES=all 
           --env=DISPLAY 
           --env=QT_X11_NO_MITSHM=1 
           -v /tmp/.X11-unix:/tmp/.X11-unix 
           --runtime=nvidia 
           -e NVIDIA_VISIBLE_DEVICES=0 
           rviz_c 
           /bin/bash

# For the latest docker version:
#docker run -it?--rm?--privileged?
#           --net=host?
#           --env=NVIDIA_VISIBLE_DEVICES=all?
#           --env=NVIDIA_DRIVER_CAPABILITIES=all?
#           --env=DISPLAY?
#           --env=QT_X11_NO_MITSHM=1 
#           -v /tmp/.X11-unix:/tmp/.X11-unix?
#           --gpus 2 
#           rviz_c 
#           /bin/bash

I checked and it runs without problems ( I could see rviz and rqt_graph) So my questions are:

  1. Where is xhost +local:docker? Isnn't that needed?
  2. If not, which of the docker run selections is making it possible to run GUI aplications?
  3. An unrelated question, but we are starting one container and running roscore in it, and starting another container and running rviz on it. How come this works if theye are two different containers? I thought until this time that it would have to be in the same container. I think I need some networking explanation.
question from:https://stackoverflow.com/questions/65867746/running-graphical-applications-on-docker

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...