Setting up two ROS2 containers in Docker
Introduction
Simple example of docker containers running ros over the physical network.
version: '2'
services:
ros1:
container_name: ros2-talker
image: osrf/ros:humble-desktop
hostname: ros-host2
domainname: test
networks:
network:
ipv4_address: 192.168.8.11
command: ros2 run demo_nodes_cpp talker
restart: unless-stopped
ros2:
container_name: ros2-listener
image: osrf/ros:humble-desktop
hostname: ros-host
domainname: test
networks:
network:
ipv4_address: 192.168.8.21
command: ros2 run demo_nodes_cpp listener
restart: unless-stopped
networks:
network:
driver: ipvlan
driver_opts:
parent: wlp1s0
ipvlan-mode: l2
ipam:
driver: default
config:
- subnet: 192.168.8.0/24
gateway: 192.168.8.1
ip_range: 192.168.8.1/24
External Resources
- https://hub.docker.com/u/linuxserver
- docker-Tutorials-Docker - ROS Wiki
- How to use Docker (with ROS) · alecGraves-wiki Wiki
- hub.docker.com
- jbohren-rosdocked- Tools for running ROS in docker with a shared username, home, and X11
- Running 2 nodes in a single docker container [community-contributed]
- Setting up ROS in Windows through Docker – Jack Kawell
- Setting up ROS in Windows through WSL – Jack Kawell
- Using ROS from a Docker image - Effective Robotics Programming with ROS - Third Edition
- https://docs.ros.org/en/galactic/How-To-Guides/Run-2-nodes-in-single-or-separate-docker-containers.html
- https://devanshdhrafani.github.io/blog/2021/04/15/dockerros2.html