1. Preparing Raspberry Pis & Docker Swarm Setup - nerdily/Raspberry-Pi-Docker-Swarm GitHub Wiki

Preparation (greatly shortened - if this is too much, stop here and go learn)

  1. Download 64-bit Ubuntu Server for Raspberry Pi
  2. Flash SD cards with Etcher or other utility
  3. Boot up

OS Setup

  1. Setup certificate-based SSH
  2. Update each Pi with sudo apt-get update && sudo apt-get upgrade
  3. Configure Pi and set up hostname, localization (time zone, language) etc.
  4. Ensure static IP is setup either via DHCP reservation or traditional static IP configuration.
  5. Reboot
  6. Ensure on each node that all members of the cluster have an entry in /etc/hosts.

Install Docker on each Pi

  1. Follow the Ubuntu installation instructions here using the apt repsitory
  2. sudo usermod -aG docker (username)

Start the Docker Swarm. On the Docker Manager:

  1. docker swarm init

Join Docker Workers to the Swarm. On each Worker node:

  1. swarm join --token (token) (manager):2377 This command should be generated from the Docker Manager

Docker Status

  1. docker node ls
ID                            HOSTNAME         STATUS    AVAILABILITY   MANAGER STATUS   ENGINE VERSION
jyhbh7ftvquajdyf8goqjrd76 *   dock-master-01   Ready     Active         Leader           24.0.2
md5jkf5dzilrfeimgj4c1jwsb     dock-worker-01   Ready     Active                          24.0.2