Was getting curious about docker containers and running Ros2 in a container. @KurtE showed me this where someone already did it: miguelgonrod/ros_arduino_uno_Q: ROS 2 Jazzy running in a container on the Arduino UNO Q to control the onboard LED via an RPC bridge between the Qualcomm MPU (Linux) and the STM32 microcontroller. A ROS 2 node subscribes to a boolean topic and triggers an RPC call to the MCU, enabling end-to-end ROS-native LED control on the UNO Q.
So to try to understand it better, started doing some digging:
The Complete Beginnerβs Guide to Docker for ROS 2 Deployment (2025) | Robotair
How to Exit a Docker Container
ROS Development Inside Docker β’ Didi Ruhyadi
So for the hell of it I log in via ./adb shell and ran the hello world test:
arduino@arduinoQ:/home$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
198f93fd5094: Pull complete
Digest: sha256:d4aaab6242e0cace87e2ec17a2ed3d779d18fbfd03042ea58f2995626396a274
Status: Downloaded newer image for hello-world:latest
Hel message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
The Docker client contacted the Docker daemon.
The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
For more examples and ideas, visit:
Get started | Docker Docs lo from Docker!
and of course since I am a glutton for punishment I ran the $ docker run -it ubuntu bash command just to see what happens. And to my surprise I was able to run Ubuntu in a container:
:/home$ docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
97dd3f0ce510: Pull complete
Digest: sha256:c35e29c9450151419d9448b0fd75374fec4fff364a27f176fb458d472dfc9e54
Status: Downloaded newer image for ubuntu:latest
root@2d53e949be0c:/# ls
bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
root@2d53e949be0c:/# cd usr
root@2d53e949be0c:/usr# ls
bin games include lib libexec local sbin share src
root@2d53e949be0c:/usr# cd lib
root@2d53e949be0c:/usr/lib# ls
aarch64-linux-gnu dpkg ld-linux-aarch64.so.1 lsb os-release systemd udev
apt init locale mime sysctl.d tmpfiles.d
root@2d53e949be0c:/usr/lib# exit
exit
An interesting command is to see what docker containers are running or stopped
docker ps -a -q
2d53e949be0c
d4bacefb5f58
e3d5c942c092
Guess more to follow. Interesting stuff. Opens up several possibilities.
Now wondering if doing this
Step 4: X11 forwarding for GUI applications
The devcontainer.json file already includes the necessary configuration for X11 forwarding. The DISPLAY environment variable is set to ${env:DISPLAY}, which forwards the X11 display from the host to the container. This allows you to run GUI applications such as RViz and Gazebo inside the container and display them on your host machine.
Any one have any thoughts about this?
Found this about linking docker containers:
Docker - Container Linking - GeeksforGeeks

