Usually you can mount the device by defining that in your docker-compose file or by command line.
But docker container won’t start if the device doesn’t exists at this moment.
For this you can use the follwing workaround.
- Connect your device to the host system to get the required information for further processing.
- Get the information by typing the follwing command:
- Add to your docker-compose file the following configuration:
- /run/udev:/run/udev:ro # so that serial number vendor/product ids are known
- 'c 188:* rmw' # allow creation of /dev/ttyUSBx nodes via mknod (see uevent:MAJOR of the device)
- In running container you can now add the device file using the following command, event if the device is not connected at the time:
mknod /dev/ttyUSB0 c 188 0