I'm trying to run a simple docker container with a python base image to control the LEDs on my RPi4.
The Dockerfile compiles fine and I'm running it as follows: docker run --rm -ti --privileged --device /dev/gpiomem:/dev/gpiomem -d led_blinker bash
Once inside the docker container I run a ls -l /dev/gpiomem and I get
root@ca1506d00cc5:/# ls -l /dev/gpiomem
crw-rw---- 1 nobody nogroup 246, 0 Dec 30 21:47 /dev/gpiomem
I try to do
root@ca1506d00cc5:/# chown root.root /dev/gpiomem
chown: changing ownership of 'dev/gpiomem': Operation not permitted
But when I run a whoami
I get I'm the root user. What is that I'm missing?
PS. I have also added the flag --user root
and got the same results.
gpiozero
library and it throws an error when trying to access the device that I need root access. Looking at this post seems I need to set the correct permisions, which I can't do for some reason – langford_js Jan 04 '22 at 15:56