This is ok to add device which by serial id:
docker run -it --rm --device /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A101A9A7-if00-port0 -v /dev:/dev ubuntu /bin/bash
This is not ok to add device which by serial path:
docker run -it --rm --device /dev/serial/by-path/pci-0000:00:14.0-usb-0:8:1.0-port0 -v /dev:/dev ubuntu /bin/bash
It reports error:
invalid argument "/dev/serial/by-path/pci-0000:00:14.0-usb-0:8:1.0-port0" for "--device" flag: bad format for path: /dev/serial/by-path/pci-0000:00:14.0-usb-0:8:1.0-port0
See 'docker run --help'.Same error if do escape string for
:
as next:docker run -it --rm --device /dev/serial/by-path/pci-0000\:00\:14.0-usb-0\:8\:1.0-port0 -v /dev:/dev ubuntu /bin/bash
bind mount
,我们现在可以使用类似于 --mount type=bind,source=/colon:path/test,destination=/data
的方式来处理它,详情请参考这里。那么我的问题是:对于
--device
,我该怎么办呢?
docker run -it --rm --device '/dev/serial/by-path/pci-0000:00:14.0-usb-0:8:1.0-port0' -v /dev:/dev ubuntu /bin/bash
- Flo''
,也不支持使用双引号""
。 - atline