Member-only story
Docker Swarm on your MAC in 5 minutes
Prerequisites:
- MACBOOK
To test your application, you may want to have a very simple environment on your local PC, then here is the right solution to go.
1/ Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2/ Install Multipass
brew install --cask multipass
3/ Provision nodes
If Multipass is installed, you will need to establish the cluster for your docker.
multipass launch lunar --name node1
multipass launch lunar --name node2
multipass launch lunar --name node3
# lunar is the ubuntu image alias
# you can have multiple terminals to create three nodes
Now you have your own cluster.
4/ Install docker
multipass shell node1
# in node1, you will need to update apt-get first
sudo apt-get update
sudo apt-get install docker.io
Perform this in the rest of the two nodes.
Make sure your docker has been started and enabled.
sudo systemctl start docker
sudo systemctl enable docker
5/ Init docker swarm
Make node1 as a leader node.