Trying but failing to use serial by-id in Docker
In my mind this should work, using a symlink to the actual serial by-id in the host:
But it doesn't. This, on the other hand, works on the same symlink, but it keeps getting mixed up with the Sailorhat, which is supposed to stay on USB1:
I don't understand why, but sometimes after a reboot USB0 and USB1 has traded places inside the Docker image. It could be avoided by using serial by-id, but isn't that supported?
6 Replies
are quite sure about your configuration snippets?
devices
entries are of the form HOST_PATH:CONTAINER_PATH[:CGROUP_PERMISSIONS]
so yours look reversed
i don't think mapping a symlink from the host to the container works by default symlink is essentially a special file that contains the path to the target, so the target must also be there inside the container, with the same exact path
/dev/serial:/dev/serial
has been working for meThis is Docker Compose, I forgot to say that. But I will try /dev/serial, thanks!
I was referring to docker compose syntax
Oh, sorry. But no, they are not reversed. Those are the symlinks I created when the serial by path with many colons stopped working. So I have symlinks (and I know they work) in the Docker Compose directory for SignalK.
/dev/sailorhat and /dev/garmin did not work for me, but /dev/ttysailorhat and /dev/ttygarmin did. And it seems like the problem that on some startups of the container they are mixed when using usb0 and usb1 is gone. 😁
sorry, I don't understand. what creates those paths? why would ones with tty work and the ones without them not?
I have no idea why one work and another one doesn't. The paths are created in Docker Compose file, as I said above, from symbolic links in the Docker Compose directory that points to the devices in serial by-id. I'm sure it would work just as well to use the serial by-id addresses in the Docker Compose file, but the symlinks makes it easy to see what is what.