tldr/pages/common/docker-service.md

29 lines
783 B
Markdown
Raw Normal View History

2020-10-28 18:34:54 +00:00
# docker service
> Manage the services on a Docker daemon.
2020-10-28 18:34:54 +00:00
> More information: <https://docs.docker.com/engine/reference/commandline/service/>.
- List the services on a Docker daemon:
2020-10-28 18:34:54 +00:00
`docker service ls`
- Create a new service:
`docker service create --name {{service_name}} {{image}}:{{tag}}`
- Display detailed information about one or more services:
2020-10-28 18:34:54 +00:00
`docker service inspect {{service_name_or_ID1 service_name_or_ID2}}`
2020-10-28 18:34:54 +00:00
- List the tasks of one or more services:
2020-10-28 18:34:54 +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}}`
- Remove one or more services:
2020-10-28 18:34:54 +00:00
`docker service rm {{service_name_or_ID1 service_name_or_ID2}}`