docs: clarify container label usage (#1319)

Co-authored-by: nils måsén <nils@piksel.se>
pull/1325/head
EDIflyer 2 years ago committed by GitHub
parent 30f36b3ca2
commit 2aa01da608
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,29 +7,53 @@ There are two options:
## Full Exclude
If you need to exclude some containers, set the _com.centurylinklabs.watchtower.enable_ label to `false`.
If you need to exclude some containers, set the _com.centurylinklabs.watchtower.enable_ label to `false`. For clarity this should be set **on the container(s)** you wish to be ignored, this is not set on watchtower.
```docker
LABEL com.centurylinklabs.watchtower.enable="false"
```
=== "dockerfile"
Or, it can be specified as part of the `docker run` command line:
```docker
LABEL com.centurylinklabs.watchtower.enable="false"
```
=== "docker run"
```bash
docker run -d --label=com.centurylinklabs.watchtower.enable=false someimage
```
```bash
docker run -d --label=com.centurylinklabs.watchtower.enable=false someimage
```
If you need to [include only containers with the enable label](https://containrrr.github.io/watchtower/arguments/#filter_by_enable_label), pass the `--label-enable` flag or the `WATCHTOWER_LABEL_ENABLE` environment variable on startup and set the _com.centurylinklabs.watchtower.enable_ label with a value of `true` for the containers you want to watch.
=== "docker-compose"
```docker
LABEL com.centurylinklabs.watchtower.enable="true"
```
``` yaml
version: "3"
services:
someimage:
container_name: someimage
labels:
- "com.centurylinklabs.watchtower.enable=false"
```
Or, it can be specified as part of the `docker run` command line:
If instead you want to [only include containers with the enable label](https://containrrr.github.io/watchtower/arguments/#filter_by_enable_label), pass the `--label-enable` flag or the `WATCHTOWER_LABEL_ENABLE` environment variable on startup for watchtower and set the _com.centurylinklabs.watchtower.enable_ label with a value of `true` on the containers you want to watch.
```bash
docker run -d --label=com.centurylinklabs.watchtower.enable=true someimage
```
=== "dockerfile"
```docker
LABEL com.centurylinklabs.watchtower.enable="true"
```
=== "docker run"
```bash
docker run -d --label=com.centurylinklabs.watchtower.enable=true someimage
```
=== "docker-compose"
``` yaml
version: "3"
services:
someimage:
container_name: someimage
labels:
- "com.centurylinklabs.watchtower.enable=true"
```
If you wish to create a monitoring scope, you will need to [run multiple instances and set a scope for each of them](https://containrrr.github.io/watchtower/running-multiple-instances).

Loading…
Cancel
Save