New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular import between container1 and container2 #666
Comments
Today, this doesn't work. The plan for linksv2 is to allow essentially this. so... 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.
|
Detached doesn't matter. The "name" param is an argument to the command in the container. |
@cpuguy83 would you have a reference config for |
@willdurand here's what worked for me...
|
@alt234 came up with the same config, thanks! |
another way should be to use a "service discovery" and automatic dns registration like skydock+skydns. This way no need to use links. Well except if you use multihosts (because skydock/skydns is not ready for that). |
You can create bidirectional links using a custom tiny DNS server. So instead of this
Try this
You can access the services with: |
This is being addressed in #1676 |
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. Simplified yml 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
my versions
I'd prefer to use just compose and docker with only my containers (No ambassador pattern, no DNS containers, no network plugins). |
Are you using the |
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?
|
I'm not sure about that. From what I've seen it's always |
this issue is evil ... |
Sad. |
Hit this also. |
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
Circular import between container1 and container2
error when I run fig up.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?
The text was updated successfully, but these errors were encountered: