0

Consider that application A is an app that provides a form of clustering with an allowed designated number of slaves to join on this cluster. Applications B, C, and D would need to join this cluster in order to function properly. What I would like to do is have application A inside a container, while having applications B, C, and D setup within their own containers. Exposing ports is not an option for this. This should be done without networking functionality as there is no modifying the code for applications A, B, C, and D. I simply would like to be able to have B, C, and D be able to access the application A from within their own containers. Perhaps this is not even possible, as this is the point of Docker / containers, isolation, however, considering docker currently has the --net option to share the host networking stack I am sure this could not be to difficult implement?

Bryan
  • 11,398
  • 3
  • 53
  • 78
matt32
  • 157
  • 1
  • 10
  • 1
    If exposing ports is "not an option" then how do the applications normally communicate with each other? File pipes? – Mark O'Connor Nov 06 '14 at 23:25
  • The applications communicate via sockets. I should say this, exposing ports could be an option, however, I am not sure it would help in this instance... – matt32 Nov 06 '14 at 23:56
  • I think this is equivalent to http://stackoverflow.com/questions/24956322/can-docker-port-forward-to-a-unix-file-socket-on-the-host-container – Andy Nov 07 '14 at 02:20

1 Answers1

1

If all containers run on one machine, then --link is intended for this sort of use-case. However applications have to be able to use different ports configured by environment variables.

There is a lot of activity on the Docker GitHub at the moment discussing clusters, groups and networking, so you should expect better native support in future.

You could consider 'weave', which creates a virtual overlay network where all your containers, even in different datacenters, can talk to each other as if they were on the same Ethernet switch. Please note I work on weave.

http://github.com/zettio/weave

Bryan
  • 11,398
  • 3
  • 53
  • 78