I am currently planning a sizeable ROS project which will contain upwards of 15 Nodes developed either in Python2.x or C++ talking to each other. We will try to isolate different tasks as individual nodes to guarentee unit-testability and modularity and to improve reusability for future projects.
The question is if creating a docker container for each individual node is worth the effort and if there are any downsides. The big upside would be that we could have vastly different systems from developer-pcs to build machines and then the devices the nodes are deployed to. Docker keeps dependencies and environment configurations in one managable place and fixes many hurdles.
But are there any significant drawbacks to that idea? Are there significant performance hits or other hurdles docker does introduce in such a scenario?
Creation of isolated ROS nodes in docker containers is not as complicated and already done before:
Since the effort is not as high, I think the improvements in testing, reusability, integration, delivery, ... are absolutely arguable if these points are scoped in your project.
Since CPU performance is no drawback in Docker, you should have a closer look on communication of ROS nodes, which means passing messages between your containered ROS nodes. Here you can find two drawbacks you should know:
Socket communication: As you can see in Networking with Docker: Don’t settle for the defaults, network access in Docker is done by additional interfaces, which will affect the TCP transmission of ROS messages. But a performance analysis in Docker network performance shows only small impact.
Nodelet usage: Since nodelets are loaded in an existing host ROS node communication between ROS node can be improved imense. Using Docker, the usage of nodelets would not be possible.
All in all, you have to consider which and how many messages are transmitted between your ROS nodes. If many images or other large messages are transmitted, further analysis would be absolutely advisable. Except a little more complicated handling of your nodes, I can't find notable points that speaks against the concept of using ROS nodes in separated Docker containers.