Hi,
I don't have perfect solution. Sharing devices is tricky
security-wise. I guess you have seen the documentation:
https://github.com/rkt/rkt/blob/master/Documentation/block-devices.md
If you don't care about security or container isolation, you can
always share all of /dev:
--volume devs,kind=host,source=/dev --mount volume=devs,target=/host-dev
But then, the device cgroup would not automatically allow the access
to the ttyUSBx device nodes. You would have to add:
--insecure-options=paths
Alternatively, to avoid giving full access to /dev, if you have a
script you can run whenever there is a new ttyUSBx available, you
could run "mknod" inside the container manually (you would need
CAP_MKNOD) and allow access to it with writing manually to the
cgroups, following the kernel documentation:
https://www.kernel.org/doc/Documentation/cgroup-v1/devices.txt
It's also possible to grant access to all devices with a specific
major, regardless of the minor number ("b 116:*"). I am not sure of
the security implications: the major number could be shared with other
devices you don't want to give to the container.
With either ways, you would not need to restart the container.
Cheers,
Alban