Volumes - Grendel61/ros-visualization GitHub Wiki

Mount a local directory to the container

As part of the Docker Run you can connect a local directory to the container to receive new files created with by the applications running in the container. This will let you edit generated files with your IDE.

A simple version of this is:

docker run ... 
  -v /[Ros-Source directory]:/home/ros/Desktop/src \

The -v adds an external volume to the container. The way to use this approach is to create a local directory [Ros-Source directory]: and put this directory under Git version control. The attached volume hangs off the /home/ros/Desktop/src This will enable the contents of the directory to be edited outside the container.

.
├── Desktop
│   └── src
├── Documents
├── Downloads
├── install
├── Music
├── noVNC
│   ├── app
│   ├── core
│   ├── docs
│   ├── po
│   ├── tests
│   ├── utils
│   └── vendor
├── Pictures
├── Public
├── Templates
├── Videos
└── ws_moveit
    ├── build
    ├── devel
    ├── logs
    └── src

Advanced Security Options

Map your group/user to the container retrieve R/W permission to the mounted directory of mounting directory in container (Note: after running this command, the user account in container will be the same as host account):

 docker run -it -p 5901:5901 \
   --user $(id -u):$(id -g) \
   --volume /etc/passwd:/etc/passwd \
   --volume /etc/group:/etc/group \
   --volume /etc/shadow:/etc/shadow \
   --volume /home/ros/Desktop:/home/ros/Desktop:rw \
   grendel61/ros-visualization:[Docker_tag]