How to let Docker containers broadcast their IP addresses or hostnames to each other?

One aspect of Docker that has always made me thinking is what’s the appropriate way to let different containers that collectively make up an application’s architecture about each others IPs and host names.

So let’s pretend that we have a Docker deployment topology similar to this:

  • oh-my-zsh installation returns non zero code
  • Start play framework app from dockerfile
  • how do I build a docker image without existing from a docker file
  • Dockerizing PostgreSQL
  • Docker For Windows - Java app deployed on a container gets a connection refused error when calling another java app deployed on another container
  • SQL Server on Mac with Docker : Login failed for user 'sa'.
  • Topology

    Each orange node represents a Container. All the containers might be running on the same physical machine or each container might have its dedicated EC2 instance. It is also possible that all Author nodes reside on one EC2 instance, and all the Publisher nodes on their own EC2 instance.

    But for the sake of this question, we can assume that they are all running on a Developer’s local machine, or each one is running on its own dedicated EC2 instance.

    How can I let all of the instances get IP addresses and/or hostnames of all the other instances as they come and go?

    So when Author 2 dies, Author 1, Author N, as well as Publisher 1,2 and N should be notified of this event. Similarly, when a new Publisher joins the topology, all other instances should be notified of its IP address and/or hostname.

    I am looking for a solution for both my local development environment, as well as one that’s suitable for a production AWS deployment. Ideally, the same solution should work both locally and on AWS.

  • Is Docker for Mac Open Source? [closed]
  • Is Tensorflow/Docker Useful for Development, or just demo/tests?
  • Docker on Ubuntu can't saturate CPU
  • Dial tcp i/o timeout with Docker in Gitlab CI build
  • Utilizing the --user param to create a user with a Dockerfile container
  • How can I install docker toolbox on windows 7
  • One Solution collect form web for “How to let Docker containers broadcast their IP addresses or hostnames to each other?”

    ETCd is exactly what you want. AWS doesn’t support any sort of multicast or broadcast traffic on their native network. Etcd which is part of CoreOS gives you a framework for service discovery. It allows you to discover nodes along with registering nodes.

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