Docker containers dependencies

composer
As a rule, you have more then one docker containers. It can be one base container (parent) and many other (children).
To connect they in docker-compose you can use the next snippets:

1. Using “links” – in common case is the most popular method. Here are network ports and volumes from parent container shares to child one.
docker-compose.yml

...
  links:
    - base
...

2. Using “volumes_from” – only volumes from parent container shares to child.
docker-compose.yml

...
  volumes_from:
    - base
...

The second way is useful when you connect your docker contaner network is applied to host network. The “links” directive cannot be used (since docker-compose v1.9).
docker-compose.yml

...
  net: "host"
...

Also, http://docs.docker.com/compose/compose-file