2. What is Docker Swarm?
• Docker Swarm is an orchestration management tool that runs on
Docker applications. It helps end-users in creating and deploying a
cluster of Docker nodes.
• Each node of a Docker Swarm is a Docker daemon, and all Docker
daemons interact using the Docker API.
• Each container within the Swarm can be deployed and accessed by
nodes of the same cluster
@2020 copyright KalKey training@2020 copyright KalKey training
3. How Does Docker Swarm Work?
• In Swarm, containers are launched using services. A service is a group
of containers of the same image that enables the scaling of
applications.
• A service is a description of a task or the state, whereas the actual task
is the work that needs to be done. Docker enables a user to create
services that can start tasks.
• Before you can deploy a service in Docker Swarm, you must have at
least one node deployed.
• There are two types of nodes in Docker Swarm:
Manager node. Maintains cluster management tasks
Worker node. Receives and executes tasks from the manager
node
@2020 copyright KalKey training
4. Cont….
• The manager node knows the status of the worker nodes in a cluster,
and the worker nodes accept tasks sent from the manager node.
Every worker node has an agent that reports on the state of the
node's tasks to the manager. This way, the manager node can
maintain the desired state of the cluster.
• The worker nodes communicate with the manager node using API
over HTTP. In Docker Swarm, services can be deployed and accessed
by any node of the same cluster. While creating a service, you'll have
to specify which container image you're going to use.
@2020 copyright KalKey training
5. Docker compose
• Docker Compose is a tool for defining and running multi-container
Docker applications.
• If you have a need to define a service that requires more than one
Docker container to function, Docker Compose might be the tool for
you.
• Docker Compose depends on the docker-compose.yml file
@2020 copyright KalKey training
6. How Docker Compose works
• Docker Compose builds a stack of applications to run a complete
service.
• The docker-compose.yml file is broken into sections, each section
represents a single container which, when combined with the other
containers, create the service.
• For example, you could have a docker-compose.yml file that consists
of two sections:
web - the web server portion of the application.
db - the database server portion of the application.
• Each section can be comprised of different components. And because
you might need to get quite specific with the web section, you could
instruct docker-compose that the web portion will be defined in the
Dockerfile
@2020 copyright KalKey training