1

Hope you are doing well.

Prior Info:

I am using Docker version 17.06.0-ce and CentOS 7.3

I am running micro services based application in which I need to run docker containers on different public ips. Port binding is not an option for me (IP:80:80) because the micro workers are running inside container without any port binding. They are just fetching data from queue, process it and send again to queue. I need to run these workers in parallel on different public ips to run the process faster. I can launch different container with same worker application set but they all are listening on same public IP (docker containers private IP is different). How can I run different containers with different public IPs?

Thanks and Regards

Zeeshan Jamal
  • 21
  • 1
  • 7
  • Why are you mapping the port at all? Why not run it without mapping the port? – Tarun Lalwani Aug 08 '17 at 06:11
  • I am not mapping the port. I need a solution without mapping a port. For an example, if I launch 2 containers worker1 and worker2 with same image both are working fine but they are routing through same public ip. What I need is, I want to run worker1 with public ip1 and worker2 with public ip2. – Zeeshan Jamal Aug 08 '17 at 06:33
  • I'm also looking for this without any luck. macvlan didn't help me. – HuseyinUslu May 03 '19 at 15:43

1 Answers1

-1

Of course you can find sufficient help in some other answers in the forum. Check these out:

Marco
  • 227
  • 1
  • 11
  • I had already checked them. These are the network configurations running for private ip network (172.16.0.0 - 172.31.255.255 is a private ip range) while I need to run containers on public ip. My application is not running on definite port. So port binding is not an option for me. – Zeeshan Jamal Aug 08 '17 at 07:28
  • I see. Without port mapping things get more difficult. Maybe you can check this https://docs.docker.com/engine/userguide/networking/get-started-macvlan/ and in addition this https://micropyramid.com/blog/assign-public-ip-address-to-docker-container-without-port-binding/ I haven't used this, yet. But it sounds promising. – Marco Aug 08 '17 at 08:40
  • First link also is for private network. Trying with second link. – Zeeshan Jamal Aug 08 '17 at 10:36
  • The _example_ in the first link is using a private network. But you should be able to use this technique to create a public one, too. This is described in the second link. In other words: the first link describes the fundamentals for the technique used in the second link. – Marco Aug 09 '17 at 07:25
  • Second link is talking about port mapping. I dont need port mapping. I need a solution without mapping a port. For an example, if I launch 2 containers worker1 and worker2 with same image both are working fine but they are routing through same public ip. What I need is, I want to run worker1 with public ip1 and worker2 with public ip2. – Zeeshan Jamal Mar 09 '18 at 09:12
  • Tried macvlan too but it stops the overall networking in the containers. – Zeeshan Jamal Mar 09 '18 at 09:14