-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
By default, Watchtower will clean up other instances and won't allow multiple instances running on the same Docker host or swarm. It is possible to override this behavior by defining a [scope](https://containrrr.github.io/watchtower/arguments/#filter_by_scope) to each running instance. | ||
|
||
Notice that: | ||
- Multiple instances can't run with the same scope; | ||
- An instance without a scope will clean up other running instances, even if they have a defined scope; | ||
!!! note | ||
- Multiple instances can't run with the same scope; | ||
- An instance without a scope will clean up other running instances, even if they have a defined scope; | ||
- Supplying `none` as the scope will treat `com.centurylinklabs.watchtower.scope=none`, `com.centurylinklabs.watchtower.scope=` and the lack of a `com.centurylinklabs.watchtower.scope` label as the scope `none`. This effectly enables you to run both scoped and unscoped watchtower instances on the same machine. | ||
|
||
To define an instance monitoring scope, use the `--scope` argument or the `WATCHTOWER_SCOPE` environment variable on startup and set the _com.centurylinklabs.watchtower.scope_ label with the same value for the containers you want to include in this instance's scope (including the instance itself). | ||
To define an instance monitoring scope, use the `--scope` argument or the `WATCHTOWER_SCOPE` environment variable on startup and set the `com.centurylinklabs.watchtower.scope` label with the same value for the containers you want to include in this instance's scope (including the instance itself). | ||
|
||
For example, in a Docker Compose config file: | ||
|
||
```yaml | ||
version: '3' | ||
|
||
services: | ||
app-monitored-by-watchtower: | ||
app-with-scope: | ||
image: myapps/monitored-by-watchtower | ||
labels: | ||
- "com.centurylinklabs.watchtower.scope=myscope" | ||
labels: [ "com.centurylinklabs.watchtower.scope=myscope" ] | ||
|
||
watchtower: | ||
scoped-watchtower: | ||
image: containrrr/watchtower | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
volumes: [ "/var/run/docker.sock:/var/run/docker.sock" ] | ||
command: --interval 30 --scope myscope | ||
labels: | ||
- "com.centurylinklabs.watchtower.scope=myscope" | ||
labels: [ "com.centurylinklabs.watchtower.scope=myscope" ] | ||
|
||
unscoped-app-a: | ||
image: myapps/app-a | ||
|
||
unscoped-app-b: | ||
image: myapps/app-b | ||
labels: [ "com.centurylinklabs.watchtower.scope=none" ] | ||
|
||
unscoped-app-c: | ||
image: myapps/app-b | ||
labels: [ "com.centurylinklabs.watchtower.scope=" ] | ||
|
||
unscoped-watchtower: | ||
image: containrrr/watchtower | ||
volumes: [ "/var/run/docker.sock:/var/run/docker.sock" ] | ||
command: --interval 30 --scope none | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters