Getting Snockered in Docker - GoPiGo3 API Installation Journey

Mounting a Raspberry Pi 5 on a GoPiGo3 robot was the start of an exciting adventure, but no challenge so great so far as installing the GoPiGo3 API into the Docker container. Previously I have re-conquered installing the GoPiGo3 API so many times, and the fact that the Docker container is running Ubuntu 22.04 which I used for the Pi4 powered “HumbleDave”, led me to expect this challenge to be minor.

While GoPi5Go-Dave easily gets off his dock to play, and returns to his dock to charge using a “Modified for Pi5 GoPiGo3 API” installed on his base PiOS Bookworm, the API and methods running 24/7 are not visible inside the Docker container.

Currently trying to install “GoPiGo3, DI_Sensors, RFRTools Python Wheels”. It takes 20 minutes for each Docker build attempt (since I am not a Docker guru…), and this is my 10th or 11th “see if this works”.

I have seen evidence there are two other folks trying to use the Raspberry Pi5 for their ROS robots, but this clearly is a “bleeding edge”.


. . .and you’re running outta band aids from the sound of it.

This is why I want to stay far, far away from things like Docker because they add additional ways for things to fail, and visibility inside of the container is limited.

I ran into the same kind of problems messing with JavaScript in a web browser when I was working on the New Remote Camera Robot project - there were dozens and dozens of interesting things I could do - but not from the main document object!


  • You can’t get there from here.
  • Likewise, you can’t get here from there either.
  • You really can’t get anywhere except within the worker thread that is using the wonderful feature - which renders it totally useless IMHO.

Worse, the only Ubuntu OS that plays nice with Pi5 is Ubuntu 23, but ROS 2 Humble only works on Ubuntu 22, so I am having to teach the Ubuntu 22 in Docker to talk to the Pi5, by adding hardware groups with privileges using udev rules Dexter created for Raspian For Robots and the Pi3, and learning more about Python packaging for multi-version Python interpreters than Dexter ever dreamed for the GoPiGo.

inside: Python 3.10 …/Dexter not visible when building the container
outside: Python 3.11 …/Dexter always visible


. . . .and you were saying what about “Beautiful Unicorns”?  :rofl:

It’s a dirty, rotten job but SOMEBODY has to do it, right?


GoPi5Go-Dave is long past “beautiful unicorn”, approaching “a giant rubber band ball” that only the “artist” thinks is beautiful.

I have import gopigo3 working but import easygopigo3 only works with sudo. Got to get the pi user inside the container to have the same privileges as the pi user outside.

(easygopigo3 has mutex protected i2c, where gopigo3 only talks SPI)


This is beginning to sound like a famous Abbot and Costello comedy routine. . . .


Weird, now neither work without sudo, work perfect with sudo python3

Docker is driving me crazy!!!


(In unison)
Third base!


Figured this one out!!! The clues:

When I start docker:

$ whoami
$ groups
$ python3
Traceback (most recent call last):
  File "/ros2ws/", line 6, in <module>, 1)
PermissionError: [Errno 13] Permission denied

$ su pi
password? xx
$ groups
pi adm dialout sudo audio video plugdev users input render gpio i2c spi netdev
$ python3  (success)

In my dockerfile I was changing user using:

USER pi:pi

I needed to not set the group ID, only the user:


That’s the problem with synthesizing from lots of different posts around the net, when you haven’t really a clue what the code you are copying does.