docker node rm

Warning: this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes.

Usage:  docker node rm [OPTIONS] NODE [NODE...]

Remove one or more nodes from the swarm

Aliases:
  rm, remove

Options:
      --force  Force remove an active node
      --help   Print usage

When run from a manager node, removes the specified nodes from a swarm.

Example output:

$ docker node rm swarm-node-02

Node swarm-node-02 removed from swarm

Removes the specified nodes from the swarm, but only if the nodes are in the down state. If you attempt to remove an active node you will receive an error:

$ docker node rm swarm-node-03

Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
down and can't be removed

If you lose access to a worker node or need to shut it down because it has been compromised or is not behaving as expected, you can use the --force option. This may cause transient errors or interruptions, depending on the type of task being run on the node.

$ docker node rm --force swarm-node-03

Node swarm-node-03 removed from swarm

A manager node must be demoted to a worker node (using docker node demote) before you can remove it from the swarm.

© 2017 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
https://docs.docker.com/v1.12/engine/reference/commandline/node_rm/