Have two containers listen on same udp port

Viewed 372

I have two applications that listen to port 3000 for UDP packets. If I run them natively, all is well.

Now, I would like to put them in Docker containers. But it appears that the process of publishing to port 3000 in the docker compose file like so:

ports:
  -"3000:3000/udp"

... creates an exclusive bind on the host's port 3000 such that the second container fails to publish its port.

Is there any way to allow two containers to do a non-exclusive bind to receive UDP traffic on the same port? I'm wondering if there is some way to tell docker to set SO_REUSEPORT to true when it does the bind.

Or maybe there is some other way to do what I need?

0 Answers
Related