I have some binaries running on ubuntu that control various devices like onboard/usb wifi/bluetooth chips. Some chips will require additional drivers.
My guess is that merely installing the drivers to the docker image is not enough, and the host OS must have the drivers. Is this correct?
If yes, why does the docker image need any drivers at all if the host already does? How can docker image correctly delegates to host? Do these need to be hardcoded for each driver on each host OS?
Also from this perspective, does docker require more or less hardcoding than a VM?
I feel the answer probably depends on how the devices are presented to docker and where the driver has to run (e.g kernel space vs user space).
Thanks!
It will depend the device and drivers. Most drivers need some support from Kernel, and in those cases your host kernel must provide the functionality. Some of the driver's functionality, dependent libraries and applications may be implemented in userspace (for example packages libusb, usbutils...) and your container should have those packages installed. And also, when running your container, you must explicitly indicate Docker to map the device in your container (any /dev/*). You have two options:
docker run
with option --device
docker run
mapping the device as a volume (option -v
) in privileged mode --privileged=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With