Docker Swarm Mode CLI Commands
The following are the docker swarm mode CLI commands:
- docker swarm init: This command is used to initialize the swarm.
docker swarm init [OPTIONS]
- docker swarm join: By using this command you can join a node to a swarm. The node joins as a manager node or worker node based on the token you pass with the –token flag.
docker swarm join [OPTIONS] HOST:PORT
- docker service creates: This is a cluster management command, and must be executed on a Swarm manager node.
docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]
- docker service inspects: This command is used to inspect the particular service and all the details will display in JSON format.
docker service inspect [OPTIONS] SERVICE [SERVICE...]
- docker service ls: This command is used to see the complete list of all the services in that network.
docker service ls [OPTIONS]
- docker service rm: This command is used to remove the specific service you want to remove.
docker service rm SERVICE [SERVICE...]
Introduction to Docker Swarm Mode
Docker swarm is a container orchestration tool. Swarm Mode in Docker was introduced in version 1.12 which enables the ability to deploy multiple containers on multiple Docker hosts. For this Docker uses an overlay network for the service discovery and with a built-in load balancer for scaling the services. One of the key advantages of docker swarm is that the configuration of the docker services such as volume and network can be modified without the need to manually restart the service Docker will update the configuration, stop the service tasks with the out-of-date configuration, and create new ones matching the desired configuration.
Table of Content
- What is Docker and Docker Container?
- What is Docker Swarm?
- What are the Task and Service in Docker Swarm?
- How Does Docker Swarm Work?
- Docker Swarm Init
- Docker Swarm Architecture
- Features of Docker Swarm
- What is Docker Swarm Used For?
- Different Modes of Docker Swarm
- How to Install and Setup Docker Swarm on AWS? A Step-By-Step Guide
- How to Setup Docker Swarm Mode?
- How to Create a Task in Docker Swarm Cluster?
- Getting Started With Swarm Mode
- What is Stack in Docker Swarm?
- Docker Swarm Mode Key Concepts
- Docker Swarm Filters
- Docker Swarm Mode CLI Commands
- Docker Container vs Docker Swarm
- Docker Swarm vs Kubernetes
- Docker Service vs Docker Task
- Benefits of Docker Swarm