I'm having hard time figuring out how to interconnect containers which belong to different docker-compose projects running on the same host.
Let's say, I'm having a set of containers in Deployment A:
root@debussy:~# docker ps | awk '{print $2}' | grep "cl"
cl-worker:latest
cl-nginx:latest
cl-app:latest
cl-rabbitmq:latest
cl-memcached:latest
cl-db:latest
All these containers where launched from a separate configuration file deployment-a.yml
. Now, we also have a different Deployment B, with its own `deployment-b.yml:
root@debussy:~# docker ps | awk '{print $2}' | grep "stockagents"
stockagents-app:latest
Is it possible to access Database(cl-db
container) from stockagents-app
by some specific configuration in deployment-b.yml
and/or deployment-a.yml
?
NOTE: I know how to do it using pure docker
command and linking containers via --link
, but is there a method to achieve the same behaviour using only docker-compose
and its configuration files ?
It seems that recent versions of docker-compose
(1.5.2 at least) have support for "external_links" option in docker-compose.yml
file which allows to specify containers started outside of the current configuration.
This is exactly the feature I was looking for when trying to share common services (MySQL for example) between containers in separate deployments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With