How to link two docker containers which are spawned with two different docker-compose.yml

I have two containers. Each one is spawned in two different docker-compose. How can I link between these containers.

Example: in a single docker-compose

  • Shared Memory with Docker containers (docker version 1.4.1)
  • Docker image with R (rocker/r.base) and python does not work when running on EC2, but local is fine
  • How to set up autoscaling RabbitMQ Cluster AWS
  • lsb_release of the host OS in a Docker
  • What happens to other processes when a Docker container's PID1 exits?
  • AWS EC2 Docker Volumes lsblk
  •   input:
      build: InputBuffer
        - queue
        - output
        - "30005:30005/udp"

    But in the links part, I want to link to another container which is spawned by another docker-compose.yml in the same host.

  • Access NFS files from Docker
  • Why docker (Container-based technologies) are useful
  • how to get logs in docker alipne haprox:1.5 logging
  • Connect to SQL Server database from a docker container
  • Docker: Unable to view running container despite successful demo example
  • Do docker pull using jenkins
  • One Solution collect form web for “How to link two docker containers which are spawned with two different docker-compose.yml”

    You should use external_links. From the docs:

    Link to containers started outside this docker-compose.yml or even
    outside of Compose, especially for containers that provide shared or
    common services.

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