Search code examples
dockerdocker-swarm

Docker Swarm that uses just nodes?


If I create a Docker 1.12 Swarm(kit) with e.g. 1 manager and 2 nodes, Swarm will use all 3 hosts to spread containers onto.

I would like to prevent Swarm from using my manager hosts for creating containers. How?


Solution

  • To prevent Docker swarm from publishing containers to a node, you need to set its availability to pause or drain using :

    docker node update --availability drain mynode
    

    You can to this for all of your managers node