It may be different on your system than on mine: echo 'c 189:* rwm' > /sys/fs/cgroup/devices/docker/$A*/devices.allow It's a bit hard to paste, but in a nutshell, you need to get the major number for your character device and send that to cgroup:ฤก89 is the major number of /dev/ttyUSB*, which you can get with 'ls -l'. See details here: Accessing USB Devices In Docker without using -privileged Using the cgroups approach is better in that respect and works on devices that get added after the container as started. Basically this allows the container to gain root on the host, which is usually not what you want. You could just use -v /dev:/dev but that's unsafe as it maps all the devices from your host into the container, including raw disk devices and so forth. You have to use cgroup devices.allow get around it. device works until your USB device gets unplugged/replugged and then it stops working.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |