Skip to content

Filter by image registry #2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
feg545 opened this issue May 8, 2025 · 1 comment
Open

Filter by image registry #2104

feg545 opened this issue May 8, 2025 · 1 comment

Comments

@feg545
Copy link

feg545 commented May 8, 2025

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

Copy link

github-actions bot commented May 8, 2025

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! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant