Skip to content

Filter by image registry #2104

Open
Open
@feg545

Description

@feg545

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

No

Describe the solution you'd like

Current Watchtower Capabilities

Watchtower currently supports the following container selection strategies:

  • Monitoring all containers
  • Monitoring containers by label
  • Excluding containers using the disable-container label

Use Case

In a typical microservices project, I use Watchtower for continuous deployment. The project includes the following images or containers:

  • mysql
  • redis
  • registry.mycompany.com/myproject/backend
  • registry.mycompany.com/myproject/web

Problem

When deploying with docker stack, the container names are dynamically generated, making the disable-by-container-name method unusable.

Using labels to distinguish containers is feasible but requires modifying my docker-compose.yml, which is a bit cumbersome.

Suggestion

I would like Watchtower to support filtering based on image repository prefixes, such as filtering by registry.mycompany.com. These are our own custom images that should be auto-updated, while images like mysql and redis from the official Docker Hub don’t need to be updated frequently.

Proposed Design

I suggest that Watchtower introduces an environment variable to filter by image name before pulling. The filter should support:

  • Comma-separated multiple filters
  • Regular expression matching (preferred)

Example usage:

WATCHTOWER_IMAGE_FILTER=^registry.mycompany.com, /myproject/

Describe alternatives you've considered

No

Additional context

No response

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