Skip to content

Update containers from registry notification #1285

@Foxite

Description

@Foxite

Is your feature request related to a problem? Please describe.
My own apps are built by CI and pushed to a private registry (registry container). Right now I have Watchtower setup to check this repository every minute, which is obviously very inefficient, but I found out that registry can send HTTP notifications, and Watchtower has an HTTP API. Perfect, except registry sends a notification for every layer that gets pushed (which can be several for a single docker push), and Watchtower checks every single container upon an API request (when we already know which ones need to be checked).

Describe the solution you'd like
To effectively automate this, at least two things need to be implemented:

  • Add an option to "debounce" API calls so that the first API call will trigger an update after a specified delay, and every other API call before the delay is over will be ignored.
  • Add an API endpoint that allows you to specify which image should be checked (not container, but image, if possible).
  • If possible, add an API endpoint that specificially gets this information from the notification sent by registry, so there doesn't need to be a script to translate a push notification to an API call.

Describe alternatives you've considered
An alternative to the first request is for someone fluent in Go (not me, unfortunately) to send a PR to https://github.com/distribution/distribution and have it debounce its notifications, which are sent in large volumes anyway.

An alternative to the second/third request is to have a separate, scoped Watchtower instance for every container you want to update in this way. Not practical if you have more than a few apps, and since registry appears to only support one notification endpoint, you'd need to have an "intermediate" API that selects the right Watchtower instance based on which image got pushed. (If you did this, you might as well have it debounce notifications.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions