When I start docker container, I got err msg, "/dev/video0"

131 Views Asked by At

When I started container without webcam devices. I got error message below.

Error response from daemon: error gathering device information while adding custom device "/dev/video2": no such file or directory

Is any option ignore connecting host PC device status When I start container?

History :

I need to connect 2 webcam devices to docker container. So I created container by command below.

docker run -it -e DISPLAY=$DISPLAY --device /dev/snd -v /tmp/.X11-unix/:/tmp/.X11-unix -v /data1/:/data1 --device=/dev/video0:/dev/video0 --device=/dev/video1:/dev/video1 --device=/dev/video2:/dev/video2 --device=/dev/video3:/dev/video3 ubuntu

Important part is this '--device' options.

--device=/dev/video0:/dev/video0 --device=/dev/video1:/dev/video1

First webcam binded /dev/video0, /dev/video1 and second webcam binded /dev/video2, /dev/video3. At that time I created container, already 2 webcam devices connected to PC. Both webcam devices worked good. I could access to both webcam.

When I start container after stop it. I got the error message (top of this article). Ofcourse, After webcam devices connected to host PC, starting container has no problem(And I tested it.)

But I using webcam devices in container is not often. So I wondering is there any option ignore connecting host PC device connecting status ?

0

There are 0 best solutions below