Feasibility of using Docker to isolate ROS and other tools in Robotics
I am very new to Docker and I want to use it to isolate ROS (Melodic), OpenCV and Deep Learning libraries. I have Ubuntu 18.04 LTS running with CUDA, Eclipse, cmake and a few other basic tools installed. Ideally, I would like three isolated entities, one each for ROS, OpenCV and Deep Learning Libraries. These three isolated entities run on top of the image of existing Ubuntu platform. When I install a new package/ module related to ROS, I don't want it to cause any conflicts with a package used by OpenCV or Deep Learning Libraries. At the same time ROS should be able to use OpenCV or Deep Learning Libraries as well as the common resources in the Ubuntu platform. I have already read this, but it only deals with ROS, not the interaction between different software packages.
1) Is such a system possible using Docker?
2) Can anyone provide some guidance regarding a roadmap towards such an implementation?
Something to consider: if a ROS node has a dependency on OpenCV, and they're not in the same image, how is the ROS node going to be linked against / use OpenCV?
@gvdhoom Based on the research I have done so far, I believe the three isolated entities I have mentioned in the question should be three different containers within same image. I think the networking and interfacing abilities of Docker would handle how ROS talks to OpenCV libraries.
So saying that you'd like three "isolated entities" with "one each for ROS, OpenCV and Deep Learning Libraries" to me implies that you'll have 3 images. They are only isolated if they don't derive from each other, in which case anything in image A cannot use anything from image B. This makes ..
.. linking/using OpenCV with ROS rather difficult.
This further suggests that the images should not share anything.
But cannot it not be designed in such a way that ROS and OpenCV have their own separate container? Something similar to Multi Container Environment mentioned here.
Think of it this way: take 2 computers. Install ROS on the first, and OpenCV on the second. You want to keep everything isolated ("don't want [..] any conflicts"), so no copying of files. How
is ROSare ROS nodes going to use OpenCV if it doesn't have access to the libraries?Multi-container setups are certainly nice and can have their benefits, but they are not magical. If your ROS node needs an OpenCV library, it's going to have to have access to that library, one way or the other. If all your images are indeed "isolated", that cannot happen.
When I use the term 'isolated', I mean isolated enough to handle the issues mentioned in first few paragraphs [Are you, ....... Docker may be for you!] of this; things like dependency conflicts.