Docker Community Forums

Share and learn in the Docker community.

IP Address aliasing?


(Mattgroves) #1

Expected behavior

docker run -d --name cb1 -p couchbase
docker run -d --name cb2 -p 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 couchbase

But the second one (cb2 above) I get an error message:

PS C:\WINDOWS\system32> docker run -d --name cb2 -p couchbase
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 bind: cannot assign requested address.
PS C:\WINDOWS\system32>


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

  1. Install Docker for Windows Beta, I’m using the default setting under ‘Network’
  2. docker run -d --name cb1 -p couchbase
  3. docker run -d --name cb2 -p 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. 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?

Run cannot assign requested address
(Alexandre) #3

Yes, you need to make sure that the IP addresses are assignable. The docker engine, as far as I understand networking, won’t be able to bind to an IP that is not part of its interfaces.

(Mattgroves) #4

Thanks for the information.

Do you know how to add virtual network adapters? It doesn’t seem to be something that the Docker for Windows interface can do. Is it something I do at the VM level? At the host level? Both?