title: mounting USB volume in docker
body: <p>I have a USB volume connected to debian host. I would like "mount" the device inside docker. Using --volume is not possible, as the device may be ephemeral and even container is also not running. </p>
  
  <p>Workflow will look something like:</p>
  
  <ul>
  <li>container will startup (will have access to only USB devices it needs to access)</li>
  <li>mount volume  inside</li>
  <li>do some work</li>
  <li>unmount </li>
  <li>stop the container</li>
  </ul>
  
  <p>This is not working for me (/dev/sdc is my usb device. ideally I want to use /dev/disk/by-id/usb-MBED_VFS_0240000048824e450041700fdedd003598d1000097969900-0:0 but --device doesn't take : in it's path)</p>
  
  <pre><code>vagrant@parallels:~$ sudo docker run --rm --interactive --tty --device /dev/sdc ubuntu
      [sudo] password for vagrant:
      root@76c5c87bd4a6:/# mkdir /tmp/1
      root@76c5c87bd4a6:/# mount /dev/sdc /tmp/1
      mount: /tmp/1: permission denied.
  </code></pre>
  
  <p>It works if --privileged is passed </p>
  
  <pre><code>vagrant@parallels:~$ sudo docker run --rm --interactive --tty --privileged --device /dev/sdc ubuntu
  root@1717829c3d16:/# mkdir /tmp/1
  root@1717829c3d16:/# mount /dev/sdc /tmp/1
  root@1717829c3d16:/# ls /tmp/1
  </code></pre>
  
  <p><strong>Why do I need to pass --privileged even if I use "--device"</strong></p>