Watchtower: Testing notification function

Created on 31 May 2019  路  9Comments  路  Source: containrrr/watchtower

I have watchtower configured through docker compose and I want to test its core functionality and email notification feature. How do I force it to send an email to check if my email settings are correct? Will it only send a notification when there is a container image update? If so, then would I just need for a container to have an update for me to test my setup? Here's what I have basically:

watchtower:
image: containrrr/watchtower
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
command: --cleanup
environment:
- WATCHTOWER_NOTIFICATIONS=email
- WATCHTOWER_NOTIFICATION_EMAIL_FROM="Watchtower" <{my Yahoo email address}>
- WATCHTOWER_NOTIFICATION_EMAIL_TO={my Yahoo email address}
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.mail.yahoo.com
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER={my Yahoo account username}
- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD={my Yahoo account password}

Anything I missed with the yml file?

When do I need to mount the docker config? I don't see a .docker folder in my root folder. I'm running Debian Stretch, btw.

Medium Awaiting user Question

Most helpful comment

Looks OK to me.

You could always try pulling whatever image you like, for example:
docker pull dockercloud/hello-world:staging

Then tag it as latest using:
docker tag dockercloud/hello-world:staging dockercloud/hello-world:latest

Run it with docker run -d dockercloud/hello-world:latest and then wait for watchtower to notice that the image hashes differ.

Hope this helps 馃檹

All 9 comments

Hi there!
Thanks a bunch for opening your first issue! :pray: As you're new to this repo, we'd like to suggest that you read our code of conduct

Looks OK to me.

You could always try pulling whatever image you like, for example:
docker pull dockercloud/hello-world:staging

Then tag it as latest using:
docker tag dockercloud/hello-world:staging dockercloud/hello-world:latest

Run it with docker run -d dockercloud/hello-world:latest and then wait for watchtower to notice that the image hashes differ.

Hope this helps 馃檹

I just did that, sorry I'm a Linux/Docker noob just trying to get by building a NAS Media Server :)

It looks like the update worked because the container ID changed but the email notification didn't. Let me try using port 465 instead.

By default though, does it connect to the SMTP server securely (TLS/SSL) or not? Port 465 doesn't work too. For my other email notification services, 587 works without secure SMTP and 465 work with secure SMTP. So I'm not sure what's going on here.

Found out what the problem is. It doesn't want this as the FROM address:

"Watchtower" <{my Yahoo email address}>

So I thought it was just a matter of a character escape (because of the space. So I tried:

"Watchtower"\ <{my Yahoo email address}>

And it still doesn't work. Is "<" also a special character that I need to escape?

Yeah, both < and > will likely need to be escaped. Good catch!

I actually realized that before you even replied but it still didn't work :( Specifying the email address alone is the workaround but I'd really like to make the original value to work.

The correct syntax is:

\"Watchtower\"\ \

But it still won't work. Any more ideas?

Also, when I try doing docker logs watchtower, there isn't really any output. Why is this?

What you're trying to do is currently not supported. This is because both the header and the actual smtp command use the same environment variable for population.

We will try to solve this in shoutrrr, but until then, im afraid you'll have to make do with just an email address.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

alexhaller picture alexhaller  路  3Comments

7imbrook picture 7imbrook  路  7Comments

meandthedevil picture meandthedevil  路  6Comments

Fredrik81 picture Fredrik81  路  5Comments