1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #31034 from erxian/refine-service-update-document

add rollback explanation to docker service update command document
This commit is contained in:
Vincent Demeester 2017-02-20 09:29:38 +01:00 committed by GitHub
commit 75843d36aa

View file

@ -154,6 +154,51 @@ $ docker service update --mount-rm /somewhere myservice
myservice
```
### Rolling back to the previous version of a service
Use the `--rollback` option to roll back to the previous version of the service.
This will revert the service to the configuration that was in place before the most recent `docker service update` command.
The following example updates the number of replicas for the service from 4 to 5, and then rolls back to the previous configuration.
```bash
$ docker service update --replicas=5 web
web
$ docker service ls
ID NAME MODE REPLICAS IMAGE
80bvrzp6vxf3 web replicated 0/5 nginx:alpine
```
Roll back the `web` service...
```bash
$ docker service update --rollback web
web
$ docker service ls
ID NAME MODE REPLICAS IMAGE
80bvrzp6vxf3 web replicated 0/4 nginx:alpine
```
Other options can be combined with `--rollback` as well, for example, `--update-delay 0s` to execute the rollback without a delay between tasks:
```bash
$ docker service update \
--rollback \
--update-delay 0s
web
web
```
### Add or remove secrets
Use the `--secret-add` or `--secret-rm` options add or remove a service's