Docker Swarm + Docker Compose: running linked containers on different nodes? -
i have application i'm running on single host via docker compose file. containers communicate 1 via rabbitmq container (so they're linked). app starting require more resources single host able provide, thought docker swarm ideal since should able spin same set of containers via same compose file on distributed nodes.
however, appears linked containers constrained reside on same node, setting docker swarm on multiple nodes won't lead container distribution i'm looking for.
the ambassador pattern seems recommended way separate linked containers (by setting proxies linked containers on each node), i'm having trouble using in docker-compose file since examples i've seen show setting each node docker run, using ip of node running shared service (rmq in case) set environment variable tell client's ambassador container route data linked service (as in https://docs.docker.com/engine/admin/ambassador_pattern_linking/). how can translated compose file such don't need know ip service running on (since docker swarm deciding after compose file complete)?
using links deprecated. instead, can create new network , add containers network:
$ docker network create myapp
note according networking documentation compose, such network created automatically compose file.
this means shouldn't need set links or networks @ all, because compose creates network automatically, , containers should reachable within network using container names.
also have @ using compose swarm limitations.
Comments
Post a Comment