From the course: Docker for Developers

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Adding nodes to the swarm

Adding nodes to the swarm - Docker Tutorial

From the course: Docker for Developers

Adding nodes to the swarm

- [Instructor] Okay, so now we have a swarm created, so you can add a node to the swarm if you want. When using the approach we just did, which is a single node swarm, you can deploy a stack to your swarm by leveraging the composed command. So let's say for example, we wanted to add workers to the swarm we just created, you could literally go into the actual directory where you have a Docker compose file like this, and then basically add all these services to your swarm. So we could go in here, and let's make sure we're in the right directory, we are, so we can see the Docker compose file. So you would do something like this command. So Docker, stack, deploy, and then the actual Yammel file. So Docker, compose .yml, like so, and then name your stack. And this would create a stack for you. So if you have access to multiple machines, physical or virtual, you can add nodes to the swarm, leveraging the command that was…

Contents