Summary

Guide for setting up ROS2 development environments using Docker, covering official ROS image resources, the distinction between runtime vs. development environments (plain Docker vs. Dev Container), and practical examples. Recommends WSL + Docker over VMware/VirtualBox for Windows users.

使用 Docker 容器化技術搭建 ROS2 開發環境的指南,涵蓋官方鏡像資源、運行環境與開發環境的區別(Dev Container),以及實際案例。對 Windows 用戶推薦使用 WSL + Docker 而非傳統虛擬機。

Key Points

  • Runtime environment: Dockerfile + docker-compose only, minimal dependencies
  • Development environment: Dev Container + Docker config, includes debuggers and editor plugins
  • Windows recommendation: WSL over VMware/VirtualBox (faster startup, GPU support, no lag in GUI)
  • Official ROS images: ros (production, slim) vs osrf/ros (dev, includes GUI tools)
  • Talker/Listener example as canonical first test for multi-container ROS2 with docker-compose

Insights

The dev container vs. runtime container distinction maps directly to the Docker best practice of separating build-time tooling from deployment images. For ROS2, this matters especially because ROS development tools (rviz2, rqt, debugging utilities) are large and irrelevant to production deployments. The WSL+Docker recommendation over native virtualization reflects NVIDIA’s GPU passthrough support in WSL2 — critical for deep learning and simulation in ROS2.

Connections

Raw Excerpt

如果你相比簡單性,更看重可移植性(比如你換了個電腦)和移植的快速性,那麼建議你結合 WSL 使用 Docker。