Balu
Balu

Reputation: 157

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

  input:
  build: InputBuffer
  links:    
    - queue
    - output
  ports:
    - "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.

Upvotes: 2

Views: 122

Answers (1)

semekh
semekh

Reputation: 3917

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.

Upvotes: 2

Related Questions