The MobileRobot Docker workflow lets you persist your entire ROS2 Humble environment as a portable Docker image and share it with teammates or students via Docker Hub. Rather than reinstalling ROS2 from scratch on every machine, you pull a pre-built image, run it as a container, customise it, and commit the result back to a new image — all without touching the host operating system. This page covers the day-to-day container operations you will use throughout the course.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xXThanatosXx/MobileRobot/llms.txt
Use this file to discover all available pages before exploring further.
Container Lifecycle
Pull the pre-built image
Open a terminal (cmd on Windows or a shell on Linux/macOS) and download the course image from Docker Hub:
Verify the image is available
Confirm the image was downloaded successfully by listing all local images:You should see
xxthanatosxx/ros2-humble with tag 1.0.0 in the output.Create a container from the image
Instantiate a new interactive container named This drops you directly into a bash shell inside the container.
ros2-humble-container:Start a stopped container
If the container already exists but is not running, start it again without creating a new one:
Container with Display Forwarding
GUI tools such asrviz2 and rqt require the container to forward its display output to the host. The command below launches the container in detached mode with the DISPLAY environment variable pointed at the host’s X server (provided by XLaunch / Xming on Windows):
| Flag | Purpose |
|---|---|
--user=user | Runs the session as the non-root user account created in the Dockerfile |
--env=DISPLAY=host.docker.internal:0 | Forwards display output to the host X server |
--volume="C:\\:/mnt/c" | Mounts the Windows C:\ drive inside the container at /mnt/c |
--network=host | Shares the host network stack, required for ROS2 DDS discovery |
-t -d | Allocates a pseudo-TTY and runs in detached (background) mode |
Optional: Shared Folder Mount
To make a specific Windows folder accessible inside the container, add a second--volume binding:
File Transfer Between Host and Container
You can copy files or entire directories in both directions usingdocker cp without needing a shared volume.
Host → Container
Creating a New Image from a Running Container
After installing packages or making configuration changes inside a container, you can snapshot those changes into a new image and push it to Docker Hub so others can pull your exact environment.List all containers to find the container ID
6485864c931d).Commit the container to a new image
Replace This creates a new local image tagged
6485864c931d with your actual container ID:xxthanatosxx/ros2-humble:1.0.0 from the container’s current filesystem state.Verify the new image
CREATED timestamp.You must be logged in to Docker Hub before pushing images. Run
docker login and enter your Docker Hub credentials if you have not done so already in the current session.