-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
Add Watchtower option for updating containers selectively #548
Comments
Let me know if it would be interesting and I can make a PR for it |
I agree with this approach and would like to see this added one way or another. On my Ansible-nas machine I have added a label per container: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had some issues in the past when watchtower was enabled and started updating specific containers, which broke functionality. To me allowing the user to specify selected containers for updating (as well as updating everything as it is now) would be a nice addition, and I implemented it on my own ansible-nas fork.
What you basically need to do is:
add a variable in watchtower like
watchtower_label_enable
(false by default), which would be a boolean and would enable updating only selected containers. Now the watchtower task becomesNow every application needs a new variable, which I called
*_watchtower_update_enabled
which is also a boolean and set to false by default. Each app receives a new docker label in the form ofThe reasoning is the following:
watchtower_enabled: false
: no containers are updated as usualwatchtower_enabled: true
andwatchtower_label_enable: false
: all containers are updated, regardless of individual preferenceswatchtower_enabled: true
andwatchtower_label_enable: true
: a label is added for watchtower to monitor only if*_watchtower_update_enabled: true
, otherwise the label is not added and the container doesn't get updated.The setup has been tested on my two ansible-nas machines and works as expected.
Side note: you need to add
recreate: true
to each application task if not there already, as labels don't get updated without a container being recreatedThe text was updated successfully, but these errors were encountered: