2020-10-28 18:34:54 +00:00
|
|
|
# docker service
|
|
|
|
|
|
|
|
> Manage the services on a docker daemon.
|
|
|
|
> More information: <https://docs.docker.com/engine/reference/commandline/service/>.
|
|
|
|
|
|
|
|
- List the services on a docker daemon:
|
|
|
|
|
|
|
|
`docker service ls`
|
|
|
|
|
|
|
|
- Create a new service:
|
|
|
|
|
|
|
|
`docker service create --name {{service_name}} {{image}}:{{tag}}`
|
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
- Display detailed information about one or more services:
|
2020-10-28 18:34:54 +00:00
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
`docker service inspect {{service_name_or_ID1 service_name_or_ID2}}`
|
2020-10-28 18:34:54 +00:00
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
- List the tasks of one or more services:
|
2020-10-28 18:34:54 +00:00
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
`docker service ps {{service_name_or_ID1 service_name_or_ID2 ...}}`
|
2020-10-28 18:34:54 +00:00
|
|
|
|
|
|
|
- Scale to a specific number of replicas for a space-separated list of services:
|
|
|
|
|
|
|
|
`docker service scale {{service_name}}={{count_of_replicas}}`
|
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
- Remove one or more services:
|
2020-10-28 18:34:54 +00:00
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
`docker service rm {{service_name_or_ID1 service_name_or_ID2}}`
|