title: How to attach a USB device to a docker container under Ubuntu
body: <p>I am trying to give a container access to a USB device on the host. The device appears to exist but docker seems unable to access it when creating the container.</p>
  <p>Any thoughts on how to proceed?</p>
  <p>The device appears to exist:</p>
  <pre><code>$ ls -l /dev/ttyUSB0
  crw-rw---- 1 root dialout 188, 0 Jun 21 20:47 /dev/ttyUSB0  
  </code></pre>
  <p>It's a Sonoff zigbee dongle:</p>
  <pre><code>$ ls -l /dev/serial/by-id
  total 0
  lrwxrwxrwx 1 root root 13 Jun 21 20:47 usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_1ec67e3b0b86ec11b4cd631719c2d21c-if00-port0 -&gt; ../../ttyUSB0
            
  </code></pre>
  <p>But when I try to pass it to a container (simple example here), I get an error:</p>
  <pre><code>$ docker run --device /dev/ttyUSB0 alpine
  docker: Error response from daemon: error gathering device information while adding custom device &quot;/dev/ttyUSB0&quot;: no such file or directory.    
  </code></pre>