Docker Swarm Cluster on Raspberry Pi with Raspbian Stretch

Docker is is on everyone’s lips and now you can also use Docker on the Raspi. But one is not enough, we’ll install a Docker Swarm Cluster. If you’d like to know more about Docker and Swarm see the homepage of Docker Community.

First install a fresh Rasbian Stretch image like explained here:

Raspberry Pi Headless Installation with SSH enabled and WLAN

Update your packages to the newest versions and install some dependencies.

Docker now supports also Debian Stretch (Docker CE Installation Guide)
So you can install Docker easiely with a Helper Script. Download the Script and execute it:

After successful setup, you can add the user ‚pi‘ to the ‚docker‘ group, to directly execute docker commands

After a reboot, you can execute the docker commands with your ‚pi‘ login:

Initializing a Swarm Cluster

Docker Swarm Documentation

To initialize the Docker Swarm Cluster execute the following command on the first Docker instance:

If you get this error…

.. you can join one of the IPv6 adresses with –advertise-addr or you can instead disable IPv6 completely:

After successfully initializing the cluster, you can get a list of cluster nodes with this command:

To add a second instance as worker node, execute the docker swarm join command, like you can see in the output of the docker swarm init command:

Docker Compose Installation

Docker Compose Documentation. To Install Docker Compose use this commands:


Schreibe einen Kommentar

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.