title: Access webcam using OpenCV (Python) in Docker?
body: <p>I'm trying to use Docker for one of our projects which uses OpenCV to process webcam feed (Python). But I can't seem to get access to the webcam within docker, here's the code which I use to test webcam access:</p>
  
  <pre><code>python -c "import cv2;print(cv2.VideoCapture(0).isOpened())"
  </code></pre>
  
  <p>And here's what I tried so far,</p>
  
  <pre><code> docker run --device=/dev/video0 -it rec bash
  
   docker run --privileged --device=/dev/video0 -it rec bash
  
   sudo docker run --privileged --device=/dev/video0:/dev/video0 -it rec bash
  </code></pre>
  
  <p>All of these return <code>False</code>, what am I doing wrong?</p>