2016-06-07 17:08:36 -07:00
|
|
|
<!--[metadata]>
|
|
|
|
+++
|
|
|
|
title = "Delete the service"
|
2016-06-15 13:26:13 -07:00
|
|
|
description = "Remove the service from the swarm"
|
2016-06-07 17:08:36 -07:00
|
|
|
keywords = ["tutorial, cluster management, swarm, service"]
|
|
|
|
[menu.main]
|
|
|
|
identifier="swarm-tutorial-delete-service"
|
|
|
|
parent="swarm-tutorial"
|
|
|
|
weight=19
|
|
|
|
+++
|
|
|
|
<![end-metadata]-->
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
# Delete the service running on the swarm
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
|
|
The remaining steps in the tutorial don't use the `helloworld` service, so now
|
2016-06-15 13:26:13 -07:00
|
|
|
you can delete the service from the swarm.
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
|
|
1. If you haven't already, open a terminal and ssh into the machine where you
|
|
|
|
run your manager node. For example, the tutorial uses a machine named
|
|
|
|
`manager1`.
|
|
|
|
|
2016-08-15 15:11:37 +08:00
|
|
|
2. Run `docker service rm helloworld` to remove the `helloworld` service.
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
|
|
```
|
|
|
|
$ docker service rm helloworld
|
2016-06-15 13:26:13 -07:00
|
|
|
|
2016-06-07 17:08:36 -07:00
|
|
|
helloworld
|
|
|
|
```
|
|
|
|
|
2016-06-21 15:28:30 +08:00
|
|
|
3. Run `docker service inspect <SERVICE-ID>` to verify that the swarm manager
|
2016-06-15 13:26:13 -07:00
|
|
|
removed the service. The CLI returns a message that the service is not found:
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
|
|
```
|
|
|
|
$ docker service inspect helloworld
|
|
|
|
[]
|
2016-08-16 14:47:13 +08:00
|
|
|
Error: no such service: helloworld
|
2016-06-07 17:08:36 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
## What's next?
|
|
|
|
|
2016-07-12 04:59:08 -07:00
|
|
|
In the next step of the tutorial, you set up a new service and apply a
|
2016-06-07 17:08:36 -07:00
|
|
|
[rolling update](rolling-update.md).
|