Skip to content

Commit 220c09d

Browse files
committed
Updated README.md to document notifications
1 parent d8586e7 commit 220c09d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ docker run --rm v2tec/watchtower --help
9898
* `--debug` Enable debug mode. When this option is specified you'll see more verbose logging in the watchtower log file.
9999
* `--help` Show documentation about the supported flags.
100100

101+
See below for options used to configure notifications.
102+
101103
## Linked Containers
102104

103105
Watchtower will detect if there are links between any of the running containers and ensure that things are stopped/started in a way that won't break any of the links. If an update is detected for one of the dependencies in a group of linked containers, watchtower will stop and start all of the containers in the correct order so that the application comes back up correctly.
@@ -161,3 +163,34 @@ docker run -d \
161163
## Updating Watchtower
162164

163165
If watchtower is monitoring the same Docker daemon under which the watchtower container itself is running (i.e. if you volume-mounted */var/run/docker.sock* into the watchtower container) then it has the ability to update itself. If a new version of the *v2tec/watchtower* image is pushed to the Docker Hub, your watchtower will pull down the new image and restart itself automatically.
166+
167+
## Notifications
168+
169+
Watchtower can send notifications when containers are updated. Notifications are sent via hooks in the logging system, [logrus](http://github.com/sirupsen/logrus).
170+
The types of notifications to send are passed via the comma-separated option `--notifications` (or corresponding environment variable `WATCHTOWER_NOTIFICATIONS`), which has the following valid values:
171+
172+
* `email` to send notifications via e-mail
173+
174+
To receive notifications by email, the following command-line options, or their corresponding environment variables, can be set:
175+
176+
* `--notification-email-from` (env. `WATCHTOWER_NOTIFICATION_EMAIL_FROM`): The e-mail address from which notifications will be sent.
177+
* `--notification-email-to` (env. `WATCHTOWER_NOTIFICATION_EMAIL_TO`): The e-mail address to which notifications will be sent.
178+
* `--notification-email-server` (env. `WATCHTOWER_NOTIFICATION_EMAIL_SERVER`): The SMTP server to send e-mails through.
179+
* `--notification-email-server-user` (env. `WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER`): The username to authenticate with the SMTP server with.
180+
* `--notification-email-server-password` (env. `WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD`): The password to authenticate with the SMTP server with.
181+
182+
Example:
183+
184+
```bash
185+
docker run -d \
186+
--name watchtower \
187+
-v /var/run/docker.sock:/var/run/docker.sock \
188+
-e WATCHTOWER_NOTIFICATIONS=email \
189+
190+
191+
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \
192+
193+
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \
194+
v2tec/watchtower
195+
```
196+

0 commit comments

Comments
 (0)