DockerCLI/docs/reference/commandline/swarm_leave.md

1.3 KiB

swarm leave

Usage:	docker swarm leave

Leave a Swarm swarm.

Options:
      --help   Print usage

This command causes the node to leave the swarm.

On a manager node:

$ docker node ls
ID              NAME           STATUS  AVAILABILITY/MEMBERSHIP  MANAGER STATUS  LEADER
04zm7ue1fd1q    swarm-node-02  READY   ACTIVE                                   
2fg70txcrde2    swarm-node-01  READY   ACTIVE                   REACHABLE       
3l1f6uzcuoa3 *  swarm-master   READY   ACTIVE                   REACHABLE       Yes

On a worker node:

$ docker swarm leave
Node left the default swarm.

On a manager node:

$ docker node ls
ID              NAME           STATUS  AVAILABILITY/MEMBERSHIP  MANAGER STATUS  LEADER
04zm7ue1fd1q    swarm-node-02  DOWN    ACTIVE                                   
2fg70txcrde2    swarm-node-01  READY   ACTIVE                   REACHABLE       
3l1f6uzcuoa3 *  swarm-master   READY   ACTIVE                   REACHABLE       Yes