Serial/COM devices in docker-compose on Windows

Hello.
I’m using Docker for Windows 10 and just updated to the following version: 17.12.0-ce-win46 (15048). Compose: 1.18.0.

An application that I’m running with compose uses Serial/COM port of a host machine. This is how I set it up in compose file:

devices:
    - "/dev/ttyS3:/dev/ttyS3"

Serial device in Windows is connected on COM4.

When I run the whole set (a Java application), I get a NoSuchPortException. Turns out that host COM4 port wasn’t forwarded into container.

Is it the right approach to map Windows COM port to a container with compose?
Does Docker for Windows actually support this functionality?

2 Likes

No feedback at all on this? Bump.

Looks like it’s not possible to map between linux and windows hosts according to this:

Would be too cool…

Hello,

Was this problem ever solved ?

Kind Regards Henrique

I know that if we use Docker desktop with WSL2, then we can map the USB/Serial ports from Windows to WSL2. But it would be very nice if Docker supports this feature out of the box.

Thanks