stack overflow explanation


To let Docker use USB we pass them in using the --device flag

Here is an example with our USB to UART adapter and Lidar plugged in

  sudo docker run --rm \
	--device /dev/ttyUSB0 \
	--device /dev/ttyUSB1 \
	my-image bash
  

To find which files in /dev are the correct USB ports I just plug run the command below then unplug and run the command again.

  ls /dev/tty*
  

the difference is the file that represents the USB port