是否可以将usb设备暴露给lxc / docker容器? [英] Is it possible to expose a usb device to a lxc/docker container?
问题描述
对于docker,我使用新的bind mount功能(请参阅 https://github.com/dotcloud/docker/issues/111 ,-b或latedly?-v选项)将主机devfs公开到容器。然而,每当我连接(cat / d / ttyACM0,d是到dev的绑定装载)到设备,我得到操作不允许。是否可能不仅绑定mount但实际使用容器中的字符设备?
是否可能通过udev规则公开特定的开发人员。
- 设备
选项现在允许将开发人员容器,例如:
docker运行-t -i --device = / dev / ttyUSB0 ubuntu bash
(发现自这个SO答案。)
I have a embedded system development image contained in a docker file. In order to flash the code I need to connect to the nodes via USB Serial (e.g. /dev/ttyACM0).
With docker I used the new bind mount feature to (see https://github.com/dotcloud/docker/issues/111, -b or latedly? -v option) to expose the hosts devfs to the container. However, whenever I connect ("cat /d/ttyACM0", d is the bind mount to dev) to the device I get "operation not permitted". Is it possible to not only bind mount but actually use character devices in the container?
Would it be maybe even possible to expose specific devs via udev rules.
The --device
option now allows exposing a dev to a container, eg.:
docker run -t -i --device=/dev/ttyUSB0 ubuntu bash
(Found from this SO answer.)
这篇关于是否可以将usb设备暴露给lxc / docker容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!