How to access gpio from docker container?

Hi,

I am trying to access the raspbery pi 3 gpio’s from the official docker image for raspberry pi 3 but with the privileged flag I cannot access the UI and without this flag I cannot acces the pin.

Does anyone know how to make it work? I need to trigger a pin ( switch.rpi_gpio) from HASS.

Command used to create the container:

docker run -p 8123:8123 --restart=always --name=“home-assistant” --privileged --cap-add SYS_RAWIO --device=/dev/mem -v /data/HASS/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant

change in

docker run -p 8123:8123 --restart=always --privileged --cap-add SYS_RAWIO --device=/dev/mem -v /data/HASS/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant