Domoticz, Docker & GPIO

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
akamming
Posts: 367
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Domoticz, Docker & GPIO

Post by akamming »

I am experimenting with moving my domoticxz install to docker. However on my pi it also uses the gpio pins for controlling a few lights

what is the best way to give that docker control to gpio? Adding just the gpio section of the sysfs component to the volumes secion in the compose yml file does not work, I tried

Code: Select all

 - /sys/class/gpio:/sys/class/gpio
and that didn't work

The following did the trick

Code: Select all

 - /sys:/sys
but basically that docker now has a lot of access to the pi i don't want to give it, so what is the best way to give gpio access to domoticz in a docker container without giving it too much permissions?
jannl
Posts: 673
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Domoticz, Docker & GPIO

Post by jannl »

You most likely need to add some librarys to you docker container. Using 'customstaart.sh' you can add/install additional libraries when start the container.

From 2022.2, this functionality is present. (use google)
akamming
Posts: 367
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz, Docker & GPIO

Post by akamming »

I am aware of that. I am already using customstart.sh Tomas the needed libertairs and also to export the GPIO pins

Problem it doesn’t work unless i expose the entire /sys fs to the docker container (apparently domotics io uses sysfs)

So my question is: hoe can i limit this from the docker container to sys as much as possible but still have gpio working within domoticz
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest