Docker for Windows error Spinning up multiple docker containers locally with same port numbers

0 votes
I'm currently running on Docker for Windows. My task is to spin up 3 or more docker containers, with the same set of ports available.

I created the first docker container and I have http://docker:8091 (or http://10.0.75.2:8091) available. Next I want to host another container with the same port number available.

I added a network adapter to MobyLinuxVM thru Hyper-V manager, but that causes docker to break down.

Someone please help me with this. Thanks in advance.
Nov 23, 2018 in DevOps & Agile by Tyrion anex
• 8,700 points
758 views

1 answer to this question.

0 votes

Alright, to publish a port, docker uses the binary docker-proxy to forward into the container. Something like this:

docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8091 -container-ip 172.17.0.2 -container-port 8091

In the above example it binds, but it would be possible to bind to specific interfaces.

So if you have 3 interfaces on your host, and the appropriate DNS record, the you can do it like this:

docker-proxy -proto tcp -host-ip 10.0.75.2 -host-port 8091 -container-ip 172.17.0.2 -container-port 8091
docker-proxy -proto tcp -host-ip 10.0.75.3 -host-port 8091 -container-ip 172.17.0.3 -container-port 8091
docker-proxy -proto tcp -host-ip 10.0.75.4 -host-port 8091 -container-ip 172.17.0.4 -container-port 8091
answered Nov 23, 2018 by Tyrion anex
• 8,700 points

Related Questions In DevOps & Agile

0 votes
2 answers

How does Docker for Windows run Linux containers?

One of the most important enhancements is ...READ MORE

answered Aug 29, 2020 in DevOps & Agile by Pistle
• 1,000 points
790 views
0 votes
1 answer

Docker for Windows error: “kubectl context missing”

There is an issue with docker for ...READ MORE

answered Aug 28, 2018 in DevOps & Agile by Tyrion anex
• 8,700 points
619 views
0 votes
1 answer

Docker for windows error: while exposing Ports

I faced a similar issue, just follow ...READ MORE

answered Aug 29, 2018 in DevOps & Agile by Tyrion anex
• 8,700 points
2,670 views
+2 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Docker for windows error: can’t access service on exposed port in windows container mode

You can try the following: Access container from different ...READ MORE

answered Dec 12, 2018 in DevOps & Agile by Tyrion anex
• 8,700 points
5,187 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP