I have a docker container running a python uwsgi app. The app sends a wake on lan broadcast packet to wake a pc in the local network.
It works fine without the use of docker (normal uwsgi app directly on the server), but with docker it won't work.
I exposed port 9/udp and bound it port 9 of the host system.
What am I missing here? Or with other words, how can I send a wake on lan command from a docker container to the outside network?
It seems that UDP broadcast from docker isn't being routed properly (possibly only broadcasted in the container itself, not on the host).
You can't send UDP WoL messages directly, as the device you're trying to control is 'offline' it doesn't show up in your router's ARP table and thus the direct message can't be delivered.
You may try setting (CLI) --network host
or (compose) network_mode: host
.
If you feel this may compromise security (since your container's/host network are more directly 'connected') or otherwise interferes with your container; you may create/use a separated 'WoL' container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With