Commandes Linux : docker service scale

DOCKER SERVICE SCALE

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

Scale one or multiple replicated services

Options:
  -d, --detach   Exit immediately instead of waiting for the service to converge

 

Scaler un service répliqué

docker service scale service=N [service=N...]

Equivaut à :
$ docker service update --replicas N service
ex :

$ docker service ls
ID                  NAME                 MODE                REPLICAS            IMAGE                                          PORTS
kn1qdmquzz1r        mystack_db           replicated          1/1                 postgres:9.4
xt2mwakr6u66        mystack_redis        replicated          1/1                 redis:alpine                                   *:30001->6379/tcp
3qi1rdmocngh        mystack_result       replicated          1/1                 dockersamples/examplevotingapp_result:before   *:5001->80/tcp
xehxo13zisbz        mystack_visualizer   replicated          1/1                 dockersamples/visualizer:stable                *:8080->8080/tcp
ryq7lsbz944j        mystack_vote         replicated          2/2                 dockersamples/examplevotingapp_vote:before     *:5000->80/tcp
q2onk7lai1xc        mystack_worker       replicated          1/1                 dockersamples/examplevotingapp_worker:latest
$ docker service scale mystack_db=3
mystack_db scaled to 3
overall progress: 3 out of 3 tasks
1/3: running   [==================================================>]
2/3: running   [==================================================>]
3/3: running   [==================================================>]
verify: Service converged
$ docker service ls
ID                  NAME                 MODE                REPLICAS            IMAGE                                          PORTS
kn1qdmquzz1r        mystack_db           replicated          3/3                 postgres:9.4
xt2mwakr6u66        mystack_redis        replicated          1/1                 redis:alpine                                   *:30001->6379/tcp
3qi1rdmocngh        mystack_result       replicated          1/1                 dockersamples/examplevotingapp_result:before   *:5001->80/tcp
xehxo13zisbz        mystack_visualizer   replicated          1/1                 dockersamples/visualizer:stable                *:8080->8080/tcp
ryq7lsbz944j        mystack_vote         replicated          2/2                 dockersamples/examplevotingapp_vote:before     *:5000->80/tcp
q2onk7lai1xc        mystack_worker       replicated          1/1                 dockersamples/examplevotingapp_worker:latest