0

I have several containers I'm running with Docker Compose. Two of them need to talk to each other, so I've linked them like this in docker-compose.yml:

serviceone:
  links:
    - servicetwo

servicetwo:
  links:
    - serviceone

But, it throws an error saying "Circular import between x and y".

This post solves the issue for people who are using Linux: how to link docker container to each other with docker-compose

Because it makes use of /var/run/docker.sock, this doesn't work on Mac because on Mac, Docker is running in a VM, and /var/run/docker.sock doesn't exist. How can I fix this circular import problem on Mac?

Community
  • 1
  • 1
Jack
  • 5,264
  • 7
  • 34
  • 43

1 Answers1

0

Links aren't designed to work with circular imports. One solution is to use a different service discovery method.

Another solution is to try out the latest docker-compose 1.5.0rc1 release with -x-networking (requires docker 1.9.0-rc1).

The new networking support will let you do circular requests. See the networking docs for more information.

dnephin
  • 25,944
  • 9
  • 55
  • 45