0

I am trying to open webcam through docker via a vm on a MacBook.

When I run:

docker run --rm -it --device=/dev/video0:/dev/video0 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$IP:0 \
    DOCKER_IMAGE

I get the error:

docker: Error response from daemon: error gathering device information while adding custom device "/dev/video0": no such file or directory.
Deeptej
  • 13
  • 3
  • Docker containers by default can't access the host video devices; this is even harder on MacOS since there's a hidden Linux VM and you need to also cross OS boundaries. It's probably much much easier to do this with MacOS-native tooling outside a container. The linked question has a (very involved!) recipe to do it, though. – David Maze Apr 17 '22 at 21:32
  • I was trying to do [this](https://medium.com/@jijupax/connect-the-webcam-to-docker-on-mac-or-windows-51d894c44468). So I have configured all the steps mentioned in the above post. – Deeptej Apr 17 '22 at 21:40

0 Answers0