Expected behavior
docker run -d --name cb1 -p 10.0.75.2:8091:8091 couchbase
docker run -d --name cb2 -p 10.0.75.3:8091:8091 couchbase
I would expect this to create two containers that I can access with different IP addresses that have the same port numbers exposed.
Actual behavior
The first command works fine:
PS C:\WINDOWS\system32> docker run -d --name cb1 -p 10.0.75.2:8091:8091 couchbase
d8ea41a0b900bb1d164bf0ba5e88a52edf99000a46b95d50002769cd48a33836
But the second one (cb2 above) I get an error message:
PS C:\WINDOWS\system32> docker run -d --name cb2 -p 10.0.75.3:8091:8091 couchbase
af7a66438f7f891485f8b84420f43747c4aafce27d2b094f17eaf5cc6b29bb1b
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint cb2 (1179ea30128361b4b6d49bfd6cb4268d83ca98e789180f24b955f9f03785aaaa): Error starting userland proxy: listen tcp 10.0.75.3:8091: bind: cannot assign requested address.
PS C:\WINDOWS\system32>
Information
I’m trying to create a cluster of Couchbase nodes. From what I can tell, each node (docker container) in that server needs to expose the same port numbers, otherwise I will be unable to use SDKs to interact with that cluster.
Note that the program using the SDK does not itself reside in a docker container, but on the host machine (or potentially some other machine on the network).
This doesn’t seem like a bug; it’s more likely that I’m doing something wrong or don’t understand something. Am I going about this wrong, and can I achieve what I want to do?
Steps to reproduce the behavior
- Install Docker for Windows Beta, I’m using the default setting under ‘Network’
- docker run -d --name cb1 -p 10.0.75.2:8091:8091 couchbase
- docker run -d --name cb2 -p 10.0.75.3:8091:8091 couchbase
I do not think this error has anything to do with couchbase specifically, but that’s what I’m using.
UPDATE: I think I have a fundamental misunderstanding of what’s going on. 10.0.75.2 is the IP address for MobyLinuxVM running in a Hyper-V VM. I guess what I’d need is to have multiple IP addresses assigned to that machine? Multiple network adapters. Is that the right way to go, and how do I make that happen?