Docker Community Forums

Share and learn in the Docker community.

Assign public ip to containers

Hi, I want to run 5 docker cointeiners with same app, it uses port 50505, I want expose this port to internet.

My server runs Ubuntu 18.04

Assigned IPs

So looks like i got 4 IP adresses

I can ssh to any of them and it works.

Now I am bit fresh with docker still learning it.

Anyone could give commands how to create network with this IP and then how to start instance with this IP’s ?

I believe its possible.

Normalli I start app like this:

docker run -d -P --net=host -v /mnt/chaindata:/go-matrix/chaindata --name matrix --restart always disarmm/matrix

But when u start 2nd instance it will crash cuz ports are used by first one

So I could fix that with IP’s