title: Exposing a TTY device in a docker container with docker for mac
body: <p>I'm trying to expose an Arduino that's plugged into my mac to a linux instance I'm running in <a href="https://docker.github.io/docker-for-mac/" rel="nofollow noreferrer">Docker for Mac</a> (no vm).</p>
  
  <p>The Arduino exposes itself as <code>/dev/tty.usbserialXXX</code>. I'm using the <code>node</code> docker image which is based upon ubuntu.</p>
  
  <p>The command I'm running is</p>
  
  <pre><code>$ docker run --rm -it -v `pwd`:/app --device /dev/tty.usbmodem1421 node bash
  docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/tty.usbmodem1421": lstat /dev/tty.usbmodem1421: no such file or directory.
  </code></pre>
  
  <p>If I try to use <code>--privileged</code></p>
  
  <pre><code>$ docker run --rm -it -v `pwd`:/app --device /dev/tty.usbmodem1421 --privileged node bash
  root@8f18fdbcf64d:/# ls /dev/tty.*
  ls: cannot access /dev/tty.*: No such file or directory
  </code></pre>
  
  <p>Nothing is exposed!</p>
  
  <p>I'm using this to expose serial devices to test <a href="https://github.com/EmergingTechnologyAdvisors/node-serialport" rel="nofollow noreferrer">serial drivers</a> in linux.</p>