Using "virtual" serial usb device in docker container

Issue type: help request
OS: Arch Linux
Server version: 18.05.0-ce

I am trying to use a “virtual” serial USB device inside of a docker image that I use and have not myself created.
Virtual means, that the device is plugged into another computer on the local net and shared via ethernet. I use socat on the computer where I run docker to create a virtual ttyUSB0 device unter /dev/ttyUSB0.

The output of ls -lah /dev/tty* is:

lrwxrwxrwx 1 root root 10 May 23 12:33 /dev/ttyUSB0 -> /dev/pts/6

This device works fine on the host. When using the docker run command with the --device flag to pass the device into the container, it shows up inside the container, but the software running in the container can’t communicate with it.
I am guessing this is, because the link that the /dev/ttyUSB0 device points to, doesn’t exist. However, using /dev/pts/6 as the device name for the --device flag doesn’t work either.

Is there a way to use this virtual device inside a docker container without having to create my own image and running socat inside the container?

Thanks for any help!


I am interested as well. Did you find a solution ?