in case anyone finds this here is what i figured out:
the trick is to run the sonos container in --net=host mode. This at the moment only works on native docker hosts (such as Linux) and thus does not work on Docker for Mac.
If you are using docker compose you can run soco based apps the following way:
sonos:
tty: true
stdin_open: true
expose:
- 1915
ports:
- 1915:1915
image: maxandersen/sonos_exporter
command:
network_mode: host
the main trick is network_mode: host
AND to bind to not just localhost but 0.0.0.0 or the direct ip as otherwise your app won't be properly exposed.
the rest are just example values (in this case for running a prometheus sonos exporter)
/max