Maybe you can instruct Akka or Netty to bind on a specific address and port, but announce itself on a different one. I don't understand Akka or Netty well enough to know if it's possible.
Otherwise, there are three things that you can try:
- check if they can announce a given IP address (the one of the host), but still bind to
0.0.0.0
, and then do "identity port-binding", i.e.docker run -p 1234:1234 …
which will expose port 1234 outside the container to port 1234 inside the container (thus mitigating the NAT a little bit); - deploy the cluster on a single Docker host, and use internal IP addresses — you won't be able to scale out to multiple machines, but to validate distributed code between deploying it to a larger system, that can help already;
- use Pipework, which lets you add extra interfaces to containers, and bridge multiple containers (on multiple hosts) together on a single network. Pipework is not officially supported by Docker, but many people found it very useful for similar scenarios.