Is it possible to expose a USB device to an LXC/Docker container?

后端 未结 3 2122
青春惊慌失措
青春惊慌失措 2021-02-13 18:20

I have an embedded system development image contained in a Docker file. In order to flash the code I need to connect to the nodes via USB Serial (e.g. /dev/ttyACM0)

3条回答
  •  日久生厌
    2021-02-13 18:47

    The --device option now allows exposing a /dev to a container, for example:

    docker run -t -i --device=/dev/ttyUSB0 ubuntu bash
    

    (I found from this Stack Overflow answer.)

提交回复
热议问题