Filter by image registry
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-containerlabel
Use Case
In a typical microservices project, I use Watchtower for continuous deployment. The project includes the following images or containers:
mysqlredisregistry.mycompany.com/myproject/backendregistry.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
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! ๐