• DepthAI
  • getAllAvailableDevices() return 0 devices when running in docker. How to fix it?

Hi,
My program works in python and the connection is ethernet. I have two cameras connected. However, when I run my program inside docker, it won't find any camera. I have tried both of the following ways and to no avail.

any thoughts or help?

BTW, I was able to shell into the docker and ping to the cameras and they are responsive and talking (from shell)


#devices = dai.Device.getAllAvailableDevices()

devices = dai.XLinkConnection.getAllConnectedDevices()

Hi jkchen46033
I think your docker has a different internal subnet which means you won't be able to connect it to a device outside the container. Try spinning it up with docker run --network="host". I think this will set the docker to use host's network stack.

Thanks,
Jaka