Docker Community Forums

Share and learn in the Docker community.

Creating a network + executing tcp-dependent applications inside elixir-docker

I’m fairly new to docker, and I’ve been trying to setup a local network in order to simulate distributed systems for Elixir nodes. This is what I’ve been able to do so far:
Create network:

docker network create ex --subnet 10.11.0.0/16

and start separate interactive shells for elixir nodes:

docker run -it --rm --name elixir-inst1 --network ex --ip 10.11.0.2 -v "$PWD":/usr/src/myapp -w /usr/src/myapp elixir iex --name node@localhost --cookie t

docker run -it --rm --name elixir-inst1 --network ex --ip 10.11.0.3 -v "$PWD":/usr/src/myapp -w /usr/src/myapp elixir iex --name node2@localhost --cookie t

This allows the nodes to ping eachother, which is all good. However, I also want two tcp-port servers to communicate on the same network:

docker run -it ....? ... ./SimElevatorServer 'port'

The server is bash-executable. How do I solve this?