containrrr / watchtower

A process for automating Docker container base image updates.
https://containrrr.dev/watchtower/
Apache License 2.0
18.7k stars 838 forks source link

Send notification containing Image Label #1888

Open Maksim-ops opened 9 months ago

Maksim-ops commented 9 months ago

Is your feature request related to a problem? Please describe.

Watchtower sends notification by default including ImageName:

Found new [00000000000.dkr.ecr.eu-west-1.amazonaws.com/api:rnd-latest](http://00000000000.dkr.ecr.eu-west-1.amazonaws.com/api:rnd-latest) image (61ba8a75057b)
Stopping /api-rnd (acb854b4f1e2) with SIGTERM
Creating /api-rnd
Removing image 0faedc94efec

There is no info of build version because watchtower does not allow update based on dynamically changing tags. Docker image stores information of commits and builds in image labels. It would be great if watchtower send labels of new image to know what image is running now.

Describe the solution you'd like

Implement notification type ImageLabel such as ImageName which can be used in template. something like this: WATCHTOWER_NOTIFICATION_TEMPLATE: '{{.ImageLabel}} in (label1, label2)'

Describe alternatives you've considered

To implement argument telling the WT which image labels to send WATCHTOWER_NOTIFICATION_LABELS: 'label1,label2' - to send specified labels WATCHTOWER_NOTIFICATION_LABELS: true - to send all labels

Additional context

No response

github-actions[bot] commented 9 months ago

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏