Different Docker 1.9 networks talk to each other?

I want to create two Docker 1.9 networks. Network A runs a web server, an application server, and a Postgres server (all containers). Network B runs a SMTP server and other containers. I need containers on Network A to get to Network B. Is it possible?

  • How to debug “WSREP: SST failed: 1 (Operation not permitted)” with a MariaDB Galera cluster in Docker?
  • How to automatically update your docker containers, if base-images are updated
  • Get host IP in docker container
  • Docker - docker-compose 'version' doesn't have any configuration options
  • Can't connect to ElasticSearch Docker cluster which run on local virtual machine using Java API
  • PM2 Keymetrics on Docker on Elastic Beanstalk configuration
  • Apache Mesos's Docker Containerizer
  • NFS Server on OSX - squash options
  • How to execute a command from the host when it's on the $PATH?
  • Docker as sandbox environment
  • How can I make all my docker containers use my proxy?
  • In Docker for Windows, permissions denied for mkdir/chown
  • One Solution collect form web for “Different Docker 1.9 networks talk to each other?”

    The libnetwork implementation includes an overlay mode:

    The overlay driver implements networking that can span multiple hosts using overlay network encapsulations such as VXLAN. For more details on its design, please see the Overlay Driver Design.

    The new native overlay network driver supports multi-host networking natively out-of-the-box.
    This support is accomplished with the help of libnetwork, a built-in VXLAN-based overlay network driver, and Docker’s libkv library.

    This tutorial explains how to make containers talk to each other even if they are on different machines, provided they are registered to the same overlay network.

    That will involve setting up first a K/V (Key/Value) store:

    https://github.com/docker/dceu_tutorials/raw/master/images/tut6-step1.png

    Now that your three nodes are configured to use the key-value store, you can create an overlay network on any node. When you create the network, it is distributed to all the nodes.

    When you create your first overlay network on any host, Docker also creates another network on each host called docker_gwbridge. Docker uses this network to provide external access for containers.

    Every container in an overlay network also gets an eth interface in the docker_gwbridge which allows the container to access the external world.
    The docker_gwbridge is similar to Docker’s default bridge network, but unlike the bridge it restricts Inter-Container Communication(ICC).
    Docker creates only one docker_gwbridge bridge network per host regardless of the number of overlay networks present.

    Docker added an entry to /etc/hosts for each container that belongs to the RED overlay network.
    Therefore, to reach container2 from container1, you can simply use its name. Docker automatically updates /etc/hosts when containers connect and disconnect from an overlay network.

    https://github.com/docker/dceu_tutorials/raw/master/images/tut6-step6.png

    At this point, container2 and container3 can communicate over the RED overlay network.
    They are both on the same docker_gwbridge but they cannot communicate using that bridge network without host-port mapping. The docker_gwbridge is used for all other traffic.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.