Is it possible to access a hardware device with a Docker image under Windows?

后端 未结 2 2158
醉话见心
醉话见心 2021-02-19 17:52

Recently, a native Docker client for Windows was released (>= Windows 7).

I wonder: is it possible to forward access to physical devices, running Windows as host

相关标签:
2条回答
  • 2021-02-19 18:08

    Windows USB devices are not currently available to Docker containers run with Docker for Windows.

    Answered by a Docker staff member on the 7th of July 2017 in the Docker forum.

    https://forums.docker.com/t/exposing-docker-to-usb-device-in-windows-10-with-docker-toolbox/29290/3

    This answer is likely to get outdated in some time, provided they will allow for this feature somehow.

    0 讨论(0)
  • 2021-02-19 18:27

    This is a bad practice as it goes against the design philosophy of containers.

    If you find yourself needing access to a hardware device, it's better to consider full virtualization such as VMware, Hyper-V, KVM/QEMU, Xen and so on.

    However, the "proper" way is to design your system so that hardware is abstracted into a network service. In this way, you deploy the service to physical machines to which the hardware is attached, and call them over the network. I don't know if this is possible in your case, but such decoupling provides a significant architectural advantage.

    0 讨论(0)
提交回复
热议问题