Run web cam by OpenCV

Hi,

I am new for Docker and I am trying to build a container for Tensorflow 1.3 and OpenCV 3.1 using GPU. I want to run using a webcam.
The issue I have is camera /dev/video just working with root user. like with I run using the root user is OpenCV read the camera input without any problems. But, when I am running with this command
docker run --rm -it --init \
–runtime=nvidia
–ipc=host
–user="(id -u):(id -g)"
-e NVIDIA_VISIBLE_DEVICES=0 -v /dev/video0:/dev/video0
myimage_tf:cuda_8tf1_3 bash
the opencv is con’t read the camera. Also, I am getting this message
groups: cannot find name for group ID 1006
and the user is
I have no name!@682f726e0d91:/$
So, I couldn’t know if the worng from run command or from building the docker file.

2 Likes