新建一个文件夹,vim docker.sh
自动共享该文件夹
#!/bin/bash
XSOCK=/tmp/.X11-unix
xhost +local:root
docker run -it \
-e DISPLAY=$DISPLAY \
-w /humble_ws \
-v $PWD:/humble_ws \
-v $XSOCK:$XSOCK \
-v $HOME/.Xauthority:/root/.Xauthority \
-v /dev/bus/usb:/dev/bus/usb \
--privileged \
--net=host \
--name=ocs2_noetic \
osrf/ros:noetic-desktop-full "$@"
标签:容器,XSOCK,新建,--,usb,docker,DISPLAY,Xauthority
From: https://www.cnblogs.com/penuel/p/17786472.html