Project/#1 AI 기반 자율주행 로봇을 이용한 매장 관리

+#14 Docker 기반호스트PC구축

얼죽아여뜨샤 2022. 9. 7. 14:52

1. docker 이미지 생성

gazebo나 rviz 같은 gui 쉽게 하기 위한 ros2 ubuntu vnc 도커 이미지 생성

https://github.com/Tiryoh/docker-ros2-desktop-vnc

 

GitHub - Tiryoh/docker-ros2-desktop-vnc: 🐳 Dockerfiles to provide HTML5 VNC interface to access Ubuntu LXDE + ROS2

🐳 Dockerfiles to provide HTML5 VNC interface to access Ubuntu LXDE + ROS2 - GitHub - Tiryoh/docker-ros2-desktop-vnc: 🐳 Dockerfiles to provide HTML5 VNC interface to access Ubuntu LXDE + ROS2

github.com

git clone https://github.com/Tiryoh/docker-ros2-desktop-vnc

sudo snap install docker
cd docker-ros2-desktop-vnc
cd foxy && docker build -t tiryoh/ros2-desktop-vnc:foxy .

**오류 

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=tiryoh%2Fros2-desktop-vnc%3Afoxy&target=&ulimits=null&version=1": dial unix /var/run/docker.sock: connect: permission denied

=> 해결

  • /var/run/docker.sock 파일의 권한을 666으로 변경하여 그룹 내 다른 사용자도 접근 가능하게 변경
sudo chmod 666 /var/run/docker.sock
  • 또는 chown 으로 group ownership 변경
sudo chown root:docker /var/run/docker.sock

 다시 재실행

cd docker-ros2-desktop-vnc
cd foxy && docker build -t tiryoh/ros2-desktop-vnc:foxy .