Dependency Tracking / SBOM Generation and Upload (push) Failing after 44s
Build, Test & Publish / Build (push) Successful in 45s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 1m14s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 29s
33 lines
547 B
Markdown
33 lines
547 B
Markdown
# Docker Swarm Snippets and Musings
|
|
|
|
## Updating Services
|
|
|
|
View services:
|
|
|
|
```bash
|
|
docker service ls
|
|
```
|
|
|
|
To scale a service up or down:
|
|
|
|
```bash
|
|
docker service scale <service_name>=<number_of_replicas>
|
|
```
|
|
|
|
Sometimes services get stuck or need to be forcefully updated:
|
|
|
|
```bash
|
|
docker service update --force <service_name>
|
|
```
|
|
|
|
To check placement and/or task history:
|
|
|
|
```bash
|
|
docker service ps <service_name> --no-trunc
|
|
```
|
|
|
|
::: tip
|
|
|
|
Sometimes if you need to force containers to restart use the update force (e.g. after restarting a node).
|
|
|
|
::: |