note: this is the same request as NAS-111106 in Jira
Although I am not the original author of the linked ticket, I will copy what he wrote, as I have the identical usecase (zwave USB stick for usage in home automation):
Description:
When creating a docker image, the ability to add devices is not present. This creates problems for containers which need access to devices such as serial ports (for example, a zwave controller) and as a result, the container has to run in host networking mode and with privileged access in order to access the device.
I imagine this could be expressed in the UI the same way that host-folders or external-interfaces would be or a free-form field.
A docker-compose example would be:
devices:
/dev/ttyACM0:/dev/ttyACM0
I guess I could create my own docker-compose yaml, but I still believe having this option in the UI would make a lot of people’s live easier.
Benefits
Adding this option will allow everyone to use host devices inside docker apps without introducing security issues by using privileged access.