📅  最后修改于: 2022-03-11 15:04:35.389000             🧑  作者: Mango
There are a couple of options. You can use the --device
flag that use can use to access USB devices without --privileged mode:
docker run -t -i --device=/dev/ttyUSB0 ubuntu bash
Alternatively, assuming your USB device is available
with drivers working, etc. on the host in /dev/bus/usb,
you can mount this in the container using privileged mode
and the volumes option. For example:
docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb ubuntu bash
Note that as the name implies, --privileged is insecure
and should be handled with care.