EOX GitLab Instance

Skip to content
Snippets Groups Projects
setup.rst 1.84 KiB
Newer Older
Fabian Schindler's avatar
Fabian Schindler committed
.. _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/