...

/

Getting Started with Docker Services

Getting Started with Docker Services

Getting started with Docker service

Let’s start with the smallest component of Docker swarm which is Docker services.

Initializing the swarm node

If you are using the Docker Desktop for Windows or for Mac, the Docker swarm comes prebuilt. You can check that using docker swarm. To initialize the swarm mode, type docker swarm init.

$ docker swarm init
Swarm initialized: current node (ayxwwpio1sksk5hi2bdqxanf4) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-19vn56bmfcc2l20jmts9gg9b152vkn47ruu6vtfwgsl3646ha2-8lcseq2vaegpjqytnnw1xgksn 192.168.65.3:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

The node you started will be a manager node. We can add other machines or hosts to this swarm network using the command above with the provided token. But for now, we will see all the operations on a single worker-manager node only. ...