ROS2 Docker development practice (volume mounting)
Hi everyone, I am now working on a project, to be specified, autoware and multiple sensors. I would like to come up with a Docker environment so that out team could share the same environment during development, and also for easy deployment as well. However when I constructed the Dockerfile, I faced below questions: (assuming docker run --rm is used)
- Should I
rosdep-install && colcon build
inside the Dockerfile? If I do so, those source code would be inside Docker, any changes/config would be disappeared after exiting the docker container. This is not ideal as we still under development, the code will be changed quite often. However if I not doing so, this come to question 2: - If I git clone the source code and mount volume to the container, then run
rosdep-install && colcon build
inside docker container, of course those changes can be saved in host, however, will all the dependence lost when I exit the docker? Whererosdep-install
actaully install?
What is the best practice for building workspace in Docker? Should I use --rm
flag for minimizing the chance installed extra packages/dependence that not included in Dockerfile (redeploy issue)?
I hope the concern behind can be delivered clearly. I look forward to here from you guys, I dont have much experience working ROS with Docker.