Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Circular import between container1 and container2 #666
I am hitting an issue where I need 2 containers to be able to communicate with each other, ie one container needs to be able to ping the other and vice versa but when I add each container in to the links section of the fig.yml file I get a
Is there a workaround for this? Isn't the link section just adding an entry in each containers host file? If so, shouldn't that be allowed for containers to be able to communicate with each other?
Here is the bit causing problems. Obviously I have changed some of the names around.
Is there something I am missing here?
Today, this doesn't work. The plan for linksv2 is to allow essentially this.
docker run -d --name amb -v /var/run/docker.sock:/var/run/docker.sock cpuguy83/docker-grand-ambassador -name container1 -name container2 docker run --name container1 -p 8000:8000 --link amb:container2 user/container1 docker run --name container2 -p 8080:8080 --link amb:container1 user/container2
Is this possible to do with fig? If so, would the following syntax be correct? I'm not completely sure how to specify that a container should run in detached mode within the fig yml.
@willdurand here's what worked for me...
referenced this issue
Dec 10, 2014
pushed a commit
Jun 4, 2015
You can create bidirectional links using a custom tiny DNS server. So instead of this
You can access the services with:
Sorry, late to the party. @dnephin, I still get circular dependency error in 1.9.0. Having read #1676 and network docs I don't yet have a suitable solution with out using work around listed above. Use case is two containers that load balance and cluster to each other.
gateway-member1: image: gateway.ex.base links: - gateway-member2:cluster.member.com hostname: gateway.example.com command: gateway.start --config conf/gateway-cluster-config.xml gateway-member2: image: gateway.ex.base links: - gateway-member1:cluster.member.com hostname: gateway.example.com command: gateway.start --config conf/gateway-cluster-config.xml
I'd prefer to use just compose and docker with only my containers (No ambassador pattern, no DNS containers, no network plugins).
Thanks @dnephin, its working with the networking commands now! I was missing the flag. One question. Our application has a quirk for binding on clustering it assumes you know the interface name for the configuration (inherited by old hazelcast libraries). We are working on a patch on our end to configure it via domain names. In the mean time can we count on the interface names that the container sees as being deterministic?