docker新建容器脚本
新建一个文件夹,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 "$@"