title: How to enable wiringpi GPIO control inside a Docker container
body: <p>I've used the answer to <a href="https://stackoverflow.com/questions/30059784/docker-access-to-raspberry-pi-gpio-pins">this question</a> to enable control of my Raspberry Pi GPIO pins from within a Docker container, which runs Alpine.</p>
  
  <pre><code>$ docker run --device /dev/gpiomem whatever
  </code></pre>
  
  <p>This works with the Python RPi.GPIO module, but not with wiringPi.</p>
  
  <p>Python and its dependencies takes up about the same space as Alpine itself, so I'd like to use wiringPi to save on install time and SD card space, and to keep things simple.</p>
  
  <p>Running wiringPi v2.46 in Raspbian directly (installed using <code>apt-get install wiringpi</code>) works fine, and I can successfully configure and trigger digital output pins.</p>
  
  <p>Running wiringPi  v2.26 in the Alpine container (installed using <code>apk add wiringpi</code>) fails when trying to configure a pin:</p>
  
  <pre><code>$ gpio -g mode 26 out
  Unable to determine hardware version. I see: Hardware   : BCM2835,
   - expecting BCM2708 or BCM2709. Please report this to projects@drogon.net
  </code></pre>
  
  <p>Is there anything I can do to expose the SOC to the container, so that wiringPi recognises it correctly? What else might be required to get this working?</p>