Getting started with Docker on your Raspberry Pi. Docker is a new technology that emerged in the last two years and took the software world by storm. What exactly is Docker and why did it became so popular in such short time? The goal of this guide is to answer these questions and to get you started with Docker on a Raspberry Pi in no time. Docker Desktop is an application for MacOS and Windows machines for the building and sharing of containerized applications and microservices. Docker Desktop delivers the speed, choice and security you need for designing and delivering containerized applications on your desktop.
Estimated reading time: 3 minutes
This tutorial introduces you to the features of Docker Engine Swarm mode. Youmay want to familiarize yourself with the key conceptsbefore you begin.
The tutorial guides you through the following activities:
- initializing a cluster of Docker Engines in swarm mode
- adding nodes to the swarm
- deploying application services to the swarm
- managing the swarm once you have everything running
This tutorial uses Docker Engine CLI commands entered on the command line of aterminal window.
If you are brand new to Docker, see About Docker Engine.
Set up
To run this tutorial, you need the following:
Three networked host machines
This tutorial requires three Linux hosts which have Docker installed and cancommunicate over a network. These can be physical machines, virtual machines,Amazon EC2 instances, or hosted in some other way. You can even use Docker Machinefrom a Linux, Mac, or Windows host. Check outGetting started - Swarmsfor one possible set-up for the hosts.
One of these machines is a manager (called manager1
) and two of them areworkers (worker1
and worker2
).
Note: You can follow many of the tutorial steps to test single-node swarmas well, in which case you need only one host. Multi-node commands do notwork, but you can initialize a swarm, create services, and scale them. Nordvpn free download mac.
Install Docker Engine on Linux machines
If you are using Linux based physical computers or cloud-provided computers ashosts, simply follow the Linux install instructionsfor your platform. Spin up the three machines, and you are ready. You can test bothsingle-node and multi-node swarm scenarios on Linux machines.
Use Docker Desktop for Mac or Docker Desktop for Windows
Alternatively, install the latest Docker Desktop for Mac orDocker Desktop for Windows application on onecomputer. You can test both single-node and multi-node swarm from this computer,but you need to use Docker Machine to test the multi-node scenarios. Unidentified developer security preferences.
- You can use Docker Desktop for Mac or Windows to test single-node featuresof swarm mode, including initializing a swarm with a single node, creatingservices, and scaling services.
- Currently, you cannot use Docker Desktop for Mac or Docker Desktop for Windowsalone to test a multi-node swarm, but many examples are applicable to asingle-node Swarm setup.
The IP address of the manager machine
The IP address must be assigned to a network interface available to the hostoperating system. All nodes in the swarm need to connect to the manager atthe IP address. Run ubuntu docker image.
Because other nodes contact the manager node on its IP address, you should use afixed IP address.
You can run ifconfig
on Linux or macOS to see a list of theavailable network interfaces.
If you are using Docker Machine, you can get the manager IP with eitherdocker-machine ls
or docker-machine ip
— for example,docker-machine ip manager1
.
The tutorial uses manager1
: 192.168.99.100
.
Open protocols and ports between the hosts
The following ports must be available. On some systems, these ports are open by default.
- TCP port 2377 for cluster management communications
- TCP and UDP port 7946 for communication among nodes
- UDP port 4789 for overlay network traffic
Getting Started With Docker On Machine
If you plan on creating an overlay network with encryption (--opt encrypted
),you also need to ensure ip protocol 50 (ESP) traffic is allowed.
What's next?
After you have set up your environment, you are ready to create a swarm.
Getting Started With Docker On Mac
The IP address must be assigned to a network interface available to the hostoperating system. All nodes in the swarm need to connect to the manager atthe IP address. Run ubuntu docker image.
Because other nodes contact the manager node on its IP address, you should use afixed IP address.
You can run ifconfig
on Linux or macOS to see a list of theavailable network interfaces.
If you are using Docker Machine, you can get the manager IP with eitherdocker-machine ls
or docker-machine ip
— for example,docker-machine ip manager1
.
The tutorial uses manager1
: 192.168.99.100
.
Open protocols and ports between the hosts
The following ports must be available. On some systems, these ports are open by default.
- TCP port 2377 for cluster management communications
- TCP and UDP port 7946 for communication among nodes
- UDP port 4789 for overlay network traffic
Getting Started With Docker On Machine
If you plan on creating an overlay network with encryption (--opt encrypted
),you also need to ensure ip protocol 50 (ESP) traffic is allowed.
What's next?
After you have set up your environment, you are ready to create a swarm.