• DepthAI
  • docker support without volume sharing

I'd like to run a usb camera in Balena OS, but that means I need docker without volume mounts. What is the blocker for enabling this feature?

this works:

docker run --rm \
     --privileged \
     -v /dev/bus/usb:/dev/bus/usb \
     --device-cgroup-rule='c 189:* rmw' \
     -e DISPLAY=$DISPLAY \
     -v /tmp/.X11-unix:/tmp/.X11-unix \
     luxonis/depthai-library:latest \
     python3 /depthai-python/examples/ColorCamera/rgb_preview.py

this doesn't:

docker run --rm \
  --privileged \
  --device=/dev/bus/usb \
  --device=/dev/usb \
  --device=/dev/dri \
  --device-cgroup-rule="c 81:* rmw" \
  --device-cgroup-rule="c 189:* rmw" \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  luxonis/depthai-library:latest \
  python3 /depthai-python/examples/ColorCamera/rgb_preview.py

Traceback (most recent call last): File "/depthai-python/examples/ColorCamera/rgb_preview.py", line 24, in <module> with dai.Device(pipeline) as device: RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

    PatrickWspanialy
    I think -v mounts the entire usb filesystem whereas the --device can only bind one USB device and won't work recursively.

    You need to explicitly bind one device for UNBOOTED state and one for BOOTED (if it is not the same which is likely to happen).

    Thanks,
    Jaka