Deploy the docker stack on one node (assign containers together, e.g. dockers)

I know that docker-compose with docker-swarm (which is now deprecated) can co-assign some services on the same node (using dependency filters like link)

I was wondering if such co-financing is possible using the modern docker roaming mode and deploying a new stack introduced in Docker 1.13

In docker-compose file version 3, links are said to be ignored when the stack is deployed in a swarm, so it's obvious that links are not a solution.

We have a group of servers for running batch short tasks, and the network between them is not very high. We want to run each batch job (which consists of several containers) on one server to avoid network overhead. Is this function implemented in docker-stack mode or in docker mode, or should we use the old dock?

In addition, I could not find collaborative planning with another container in the placement policy.

+5
source share
2 answers

@Roman: You are right.

To deploy with a specific node, you need to use a placement policy:

version: '3' services: job1: image: example/job1 deploy: placement: node.hostname: node-1 networks: - example job2: image: example/job2 deploy: placement: node.hostname: node-1 networks: - example networks: example: driver: overlay 
+1
source

You can still use depends_on

Worth a look at dockerize .

-1
source

Source: https://habr.com/ru/post/1263161/


All Articles