Skip to content

Commit

Permalink
Document script behavior on label collision
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed Jan 27, 2024
1 parent 6d0e96e commit ba095ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/how-tos/stop-containers-during-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ nav_order: 1

# Stop containers during backup

{: .note }
In case you are running Docker in Swarm mode, [dedicated documentation](./use-with-docker-swarm.html) on service and container restart applies.

In many cases, it will be desirable to stop the services that are consuming the volume you want to backup in order to ensure data integrity.
This image can automatically stop and restart containers and services.
By default, any container that is labeled `docker-volume-backup.stop-during-backup=true` will be stopped before the backup is being taken and restarted once it has finished.
Expand Down
4 changes: 4 additions & 0 deletions docs/how-tos/use-with-docker-swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ The mechanisms described in this page __do only apply when Docker is running in

Stopping and restarting containers during backup creation when running Docker in Swarm mode is supported in two ways.

{: .important }
Make sure you label your services and containers using only one of the describe approaches.
In case the script encounters a container that is labeled and has a parent service that is also labeled, it will exit early.

### Scaling services down to zero before scaling back up

When labeling a service in the `deploy` section, the following strategy for stopping and restarting will be used:
Expand Down

0 comments on commit ba095ea

Please sign in to comment.