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,280 points
38 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,280 points

Related Questions In DevOps & Agile

0 votes
1 answer

How does Docker for Windows run Linux containers?

Docker for Windows still uses a Linux ...READ MORE

answered Aug 24, 2018 in DevOps & Agile by Tyrion anex
• 8,280 points
53 views
0 votes
1 answer

Docker for Windows error: “kubectl context missing”

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

answered Aug 27, 2018 in DevOps & Agile by Tyrion anex
• 8,280 points
27 views
0 votes
1 answer

Docker for windows error: while exposing Ports

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

answered Aug 28, 2018 in DevOps & Agile by Tyrion anex
• 8,280 points
740 views
0 votes
1 answer
0 votes
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,280 points
359 views