如何在docker容器中调用物理主机的图形显示功能(X Server)

相关:

https://garage.readthedocs.io/en/latest/user/docker.html



image





Enabling environment visualization
Allow the Docker container to access the X server on your machine by running:

xhost +local:docker
and while running the Docker container, add the following arguments to docker run:

-v /tmp/.X11-unix:/tmp/.X11-unix
-e DISPLAY=$DISPLAY
-e QT_X11_NO_MITSHM=1
For example:

docker run
-it
--rm
-e MJKEY="\((cat ~/.mujoco/mjkey.txt)" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=\)DISPLAY
-e QT_X11_NO_MITSHM=1
rlworkgroup/garage
python examples/tf/trpo_swimmer.py







posted on 2025-01-30 23:53  Angry_Panda  阅读(85)  评论(0)    收藏  举报

导航