Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.. _setup:
Setup
=====
In this chapter the setup of a new VS stack is detailed. Before this step can
be done, the configuration and environment files need to be present. These
files can be added manually, or be created in the initialization step.
Docker
------
In order to deploy the Docker Swarm stack to the target machine, Docker and
its facilities need to be installed. This step depends on the systems
architecture. On a Debian based system this may look like this:
.. code-block:: bash
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
# add the apt repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
# fetch the package index and install Docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
## TODO: RHEL?
Docker Swarm
------------
Now that Docker is installed, the machine can either create a new swarm or join
an existing one.
To create a new Swarm, the following command can be used:
.. code-block:: bash
docker swarm init
Alternatively, an existing Swarm can be joined. The easiest way to do this, is
to obtain a ``join-token``. On an existing Swarm manager (where a Swarm was
initialized or already joined as manager) run this command:
.. code-block:: bash
docker swarm join-token worker
This prints out a command that can be run on a machine to join the swarm:
.. code-block:: bash
docker swarm join --token <obtained token>
Additional information for swarm management can be obtained in the official
documentation of the project:
https://docs.docker.com/engine/reference/commandline/swarm/