Recall & Review
beginner
What is Docker Swarm?
Docker Swarm is a tool that lets you manage a group of Docker engines as a single virtual system. It helps you deploy and scale services easily across multiple machines.
Click to reveal answer
beginner
How do you initialize a Docker Swarm on a manager node?
You run the command
docker swarm init on the machine you want to be the manager. This sets up the swarm and makes that node the leader.Click to reveal answer
beginner
What command deploys a new service in Docker Swarm?
Use
docker service create followed by options and the image name. For example, docker service create --name myweb nginx deploys an Nginx service named 'myweb'.Click to reveal answer
beginner
What does the
--replicas option do when deploying a service?It sets how many copies (instances) of the service you want running. For example,
--replicas 3 runs three copies of the service.Click to reveal answer
intermediate
How can you update a running service in Docker Swarm?
Use
docker service update with options to change the service. For example, docker service update --replicas 5 myweb changes the number of replicas to 5.Click to reveal answer
Which command initializes a Docker Swarm manager node?
✗ Incorrect
The command
docker swarm init sets up the current node as a Swarm manager.What does the command
docker service create --replicas 4 nginx do?✗ Incorrect
The command creates a new service with 4 replicas of the nginx container.
How do you add a worker node to an existing Docker Swarm?
✗ Incorrect
Worker nodes join the swarm using
docker swarm join with the manager's join token and IP address.Which command shows the list of services running in a Docker Swarm?
✗ Incorrect
docker service ls lists all services deployed in the swarm.What happens if you scale a service to zero replicas?
✗ Incorrect
Setting replicas to zero stops all running tasks of that service.
Explain the steps to deploy a new service in Docker Swarm from scratch.
Think about setting up the swarm first, then adding nodes, then deploying the service.
You got /4 concepts.
Describe how to update the number of replicas for a running service in Docker Swarm.
Focus on the command that changes service settings without redeploying.
You got /3 concepts.