Search code examples
dockerdocker-run

How to attach two devices to docker using docker run --devices?


I need to attach /dev/video0 and /dev/ttyUSB0 to container.

Both docker run --device=/dev/video0 (...) and docker run --device=/dev/ttyUSB0 (...) work but how to attach them both at the same time?


Solution

  • You can use the --device flag multiple times.

    docker run --device=/dev/video0 --device=/dev/ttyUSB0 (...)