1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/docs/reference/commandline/service_scale.md
Vincent Demeester f4cfc6b983
Updates on cli reference documentation
- Update ps with `--last` flag
- Update commands with current output
- Make sure hugo does not detect the wrong language
- Update usage for `tag` command to be more coherent with the other ones

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-07-07 20:43:18 +02:00

1.9 KiB

service scale

Usage:  docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]

Scale one or multiple services

Options:
      --help   Print usage

Examples

Scale a service

If you scale a service, you set the desired number of replicas. Even though the command returns directly, actual scaling of the service may take some time.

For example, the following command scales the "frontend" service to 50 tasks.

$ docker service scale frontend=50
frontend scaled to 50

Directly afterwards, run docker service ls, to see the actual number of replicas

$ docker service ls --filter name=frontend

ID            NAME      REPLICAS  IMAGE         COMMAND
3pr5mlvu3fh9  frontend  15/50     nginx:alpine

You can also scale a service using the docker service update command. The following commands are therefore equivalent:

$ docker service scale frontend=50
$ docker service update --replicas=50 frontend

Scale multiple services

The docker service scale command allows you to set the desired number of tasks for multiple services at once. The following example scales both the backend and frontend services:

$ docker service scale backend=3 frontend=5
backend scaled to 3
frontend scaled to 5

$ docker service ls
ID            NAME      REPLICAS  IMAGE         COMMAND
3pr5mlvu3fh9  frontend  5/5       nginx:alpine
74nzcxxjv6fq  backend   3/3       redis:3.0.6