Difficulty: Beginner
Estimated Time: 10 minutes

In this scenario, you will learn how to use Docker Compose and Stacks to deploy services on a Docker Swarm Mode cluster. The new Stacks features were added as part of the Docker Compose version 3 (v3) improvements.

In this scenario, we used docker stack to deploy services using docker compose.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Advanced Docker Stack

Step 1 of 3

Step 1 - Initialise Swarm Mode

By default, Docker works as an isolated single-node. All containers are only deployed onto the engine. Swarm Mode turns it into a multi-host cluster-aware engine.

Task: Initialise Swarm Mode

To use the secrets functionality, Docker has to be in "Swarm Mode". This is enabled via docker swarm init

In this scenario, we are using single node swarm cluster. We will create and test services. In the production environment, swarm mode provides a fault-tolerant platform with cluster management features to keep your services running and available.