As of this week (?), dynamically plugged usb devices no longer show in /dev
.
Setup:
- multi-container app
- Dockerfile for affected container sets “ENV UDEV=1” and does not override the ENTRYPOINT
- It is run as “privileged”
When I connect a USB device (example is an ESP32 but I’ve tried many others with same result), it shows up in lsusb
:
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
dmesg
even shows the port the device is attached to (ttyUSB0):
[ 472.505837] usbcore: registered new interface driver cdc_acm
[ 588.133495] usb 1-1.4: new full-speed USB device number 5 using xhci_hcd
[ 588.244833] usb 1-1.4: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[ 588.253373] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 588.260848] usb 1-1.4: Product: CP2104 USB to UART Bridge Controller
[ 588.267342] usb 1-1.4: Manufacturer: Silicon Labs
[ 588.272167] usb 1-1.4: SerialNumber: 0160B5B8
[ 588.540347] usbcore: registered new interface driver cp210x
[ 588.546444] usbserial: USB Serial support registered for cp210x
[ 588.564967] usb 1-1.4: cp210x converter now attached to ttyUSB0
If I plug in a second device, dmesg reports cp210x converter now attached to ttyUSB1
.
However, neither list in /dev.
Possibly relevant is a recent change to no longer run the container as root, i.e. added
RUN useradd -m -s /bin/bash -G dialout,netdev -U -u 1000 iot \
&& echo 'iot ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo
USER iot
WORKDIR /home/iot
CMD [ "/bin/bash", "/usr/local/bin/start.sh" ]
Maybe this “broke” the usb mount - if so, what’s the fix?