Dockerfile
The Dockerfile defines the container image based on the official ROS2 Jazzy Desktop Full image.Base image
Environment variables
Key components installed
Build tools
- Python 3 with pip
- colcon (ROS2 build tool)
- rosdep (dependency management)
- vcstool (repository management)
- argcomplete (shell completion)
- build-essential
- git, vim, wget, curl
Gazebo Harmonic
- Gazebo Harmonic simulator
- ROS2-Gazebo bridge (
ros-jazzy-ros-gz)
Navigation and SLAM
- Navigation2 stack
- Cartographer SLAM
- CycloneDDS RMW implementation
ROS2 development tools
- RViz2 (3D visualization)
- rqt and common plugins
- robot_state_publisher
- joint_state_publisher (with GUI)
- xacro (XML macros)
- tf2 tools
Teleoperation
- teleop_twist_keyboard
- teleop_twist_joy
Control packages
- ros2_control
- ros2_controllers
- controller_manager
Graphics support
- Mesa utilities
- OpenGL drivers
- Vulkan drivers
- X11 applications
Python packages
- setuptools
- numpy
- transforms3d
Workspace setup
devcontainer.json
Configures VS Code and the development container environment.Basic configuration
VS Code extensions
Automatically installed extensions:ms-python.python- Python language supportms-vscode.cpptools- C/C++ language supportms-vscode.cmake-tools- CMake integrationtwxs.cmake- CMake syntax highlightingms-iot.vscode-ros- ROS development tools
VS Code settings
Dev Container features
Common utilities
Desktop environment
Port forwarding
- Port 6080: noVNC web interface (auto-opens in browser)
- Port 5901: VNC server
Environment variables
| Variable | Value | Purpose |
|---|---|---|
DISPLAY | :1 | X11 display for GUI applications |
ROS_DOMAIN_ID | 30 | ROS2 network domain |
TURTLEBOT3_MODEL | burger | Default TurtleBot3 model |
RMW_IMPLEMENTATION | rmw_cyclonedds_cpp | DDS implementation |
GZ_VERSION | harmonic | Gazebo version |
QT_QPA_PLATFORM | xcb | Qt platform abstraction |
LIBGL_ALWAYS_SOFTWARE | Inherited | Software rendering fallback |
Container runtime arguments
--network=host: Use host network for ROS2 communication--privileged: Required for hardware access--shm-size=2gb: Increased shared memory for Gazebo--device=/dev/dri: GPU device access
Host requirements
Lifecycle scripts
postCreateCommand: Runs once when container is first createdpostStartCommand: Runs every time the container starts