Docker - Delete services using the docker service rm command

by
Jeremy Canfield |
Updated: February 12 2022
| Docker articles
The docker service rm <name|ID> command can be used to remove a service. Let's say the docker service ls command returns something like this.
ID NAME MODE REPLICAS IMAGE PORTS
jwwpwkpzkqe0 foo-service repliacted 1/1 server1.example.com/foo:latest *:8101->8080/tcp
rof5uwjm749q bar-service repliacted 1/1 server1.example.com/bar:latest *:8155->8104/tcp
v771iegeoxrm service003 repliacted 1/1 server1.example.com/helloworld:latest *:8123->8000/tcp
Here is how foo-service could be removed.
docker service rm foo-service
Or using the service ID.
docker service rm jwwpwkpzkqe0
Did you find this article helpful?
If so, consider buying me a coffee over at