docker-ros2-development

Configure Docker containers and docker-compose stacks for ROS2 robotic development and deployment.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill docker-ros2-development-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-ros2-development
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/docker-ros2-development
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill docker-ros2-development-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Containerizing ROS2 workspaces introduces failure modes that plain Docker knowledge does not cover: DDS multicast discovery breaks across bridge networks, GPU passthrough needs NVIDIA Container Toolkit wiring, GUI tools like rviz2 require X11 or Wayland forwarding, and naive Dockerfiles produce bloated multi-gigabyte runtime images. This Skill provides tested patterns for each of these problems. ## Core Features & Use Cases - Multi-Stage Dockerfiles: Separate dev, build, and runtime stages with rosdep layer caching so production images contain only the colcon install space. - Docker Compose Orchestration: One container per subsystem (perception, navigation, driver) with health checks, dev/deploy profiles, and shared memory configuration for zero-copy image transport. - DDS Networking: CycloneDDS and FastDDS XML configs for unicast peer discovery across bridge networks, plus guidance on host, bridge, and macvlan networking trade-offs. - Hardware Access: GPU passthrough via NVIDIA Container Toolkit, USB camera and serial device passthrough with udev rules, and X11/Wayland forwarding for rviz2. - Use Case: You are deploying a ROS2 Humble perception stack on a Jetson and need a minimal runtime image, GPU access for YOLO inference, and DDS communication between the camera driver and perception containers. ## Quick Start Ask the assistant to write a multi-stage Dockerfile and docker-compose setup for your ROS2 Humble workspace with GPU support and CycloneDDS networking.

Frequently Asked Questions about docker-ros2-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I containerize a ROS2 workspace with Docker?

Use a multi-stage Dockerfile based on official OSRF images like ros:humble-ros-base. Copy package.xml files first for rosdep dependency caching, then copy source and run colcon build in a build stage, and copy only the install space into a minimal ros-core runtime stage.

Why can't ROS2 nodes in different Docker containers discover each other?

DDS uses multicast for discovery by default, and Docker bridge networks do not forward multicast. Fix it by using network_mode: host, or configure CycloneDDS or FastDDS with explicit unicast peer lists pointing at the container service names.

How do I use a GPU inside a ROS2 Docker container?

Install NVIDIA Container Toolkit on the host, then declare GPU access in docker-compose under deploy.resources.reservations.devices with driver nvidia and capabilities gpu. Verify inside the container with nvidia-smi and a CUDA availability check.

How do I run rviz2 from inside a Docker container?

Forward the host X11 socket by mounting /tmp/.X11-unix, passing the DISPLAY environment variable, and setting QT_X11_NO_MITSHM=1. Run xhost +local:docker on the host to authorize container access to the X server.

Should I use host or bridge networking for ROS2 in Docker?

Host networking lets DDS multicast work natively and is simplest for single-machine development. Bridge networking isolates containers but requires unicast DDS peer configuration; macvlan gives containers real LAN IPs for multi-robot setups.

How do I pass USB cameras and serial devices into Docker containers?

Map devices with the devices field, for example /dev/video0 for cameras and /dev/ttyUSB0 for serial controllers, and add the video or dialout groups. Create host udev rules with stable symlinks so device paths survive USB re-enumeration.