I'm having a few docker containers (Using docker-compose
and a single network - network-sol)
One of the containers is a Spring Boot application
that sends UDP broadcast to the local network. 255.255.255.255 fails because It's the local broadcast address of network-sol
How can I broadcast UDP messages such as the "top local network" Will get those packets? Do i have to use directed broadcast address
for that?
P.S
broadcast works if the application is deployed outside of docker (part of the local network
You should either run the service defined in your docker-compose.yml
file with network_mode: host
.
Alternatively you can publish the port of the container you intended to communicate with by publishing it using the following configuration. Note that the /udp
is required for UDP communication to work.
service:
ports:
- "8080:8080/udp"
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