docker_practice/swarm_mode/rolling_update.md

47 lines
1.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# SWarm mode
[](deploy.md) 使 `nginx:1.13.7-alpine` `nginx`
`NGINX` `1.13.12` Swarm mode
使
Swarm mode
使 `docker service update`
```bash
$ docker service update \
--image nginx:1.13.12-alpine \
nginx
```
使 `--image` 使 `docker service update`
`--secret-add`
`--secret-rm`
`docker service update -h`
## 退
`nginx` `nginx:1.13.12-alpine` 使退
```bash
$ docker service rollback nginx
```
使 `docker service ps` `nginx`
```bash
$ docker service ps nginx
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
rt677gop9d4x nginx.1 nginx:1.13.7-alpine VM-20-83-debian Running Running about a minute ago
d9pw13v59d00 \_ nginx.1 nginx:1.13.12-alpine VM-20-83-debian Shutdown Shutdown 2 minutes ago
i7ynkbg6ybq5 \_ nginx.1 nginx:1.13.7-alpine VM-20-83-debian Shutdown Shutdown 2 minutes ago
```
退