Skip to content
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 option to search for updates at startup #1696

Closed
FilipLaurentiu opened this issue Jul 12, 2023 · 4 comments
Closed

Add option to search for updates at startup #1696

FilipLaurentiu opened this issue Jul 12, 2023 · 4 comments

Comments

@FilipLaurentiu
Copy link

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

I have a few docker containers that I run once I start my PC and I want to use watchtower to monitor them for updates each day. If I use the default update interval, 24 hours, watchtower will never check for updates because each time I restart the container it also reset this interval.

Describe the solution you'd like

The solution I see is to check for update immediately after it starts

Describe alternatives you've considered

My current solution is to set a lower updater interval, a few hours, but this is not ideal.

Additional context

No response

@github-actions
Copy link

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

@piksel
Copy link
Member

piksel commented Jul 12, 2023

There is --run-once that does a check on startup, but it cannot be combined with a schedule. If you restart your computer once per day it would effectively be the same as having a 24h schedule.
Allowing both has been proposed and drafted before, but no concrete implementation has been done so far.

@FilipLaurentiu
Copy link
Author

There is --run-once that does a check on startup, but it cannot be combined with a schedule. If you restart your computer once per day it would effectively be the same as having a 24h schedule. Allowing both has been proposed and drafted before, but no concrete implementation has been done so far.

Hmm.. I try it this way. I have a docker-compose file and add --run-once to the watchtower container but doesn't seems to work good.
I can't have a restart policy anymore. The container will start, check for updates, and exit. Next time I open my pc the container will be stopped.
And if I set a restart policy, docker will restart the container in an infinite loop.

@simskij
Copy link
Member

simskij commented Jul 24, 2023

There is --run-once that does a check on startup, but it cannot be combined with a schedule. If you restart your computer once per day it would effectively be the same as having a 24h schedule. Allowing both has been proposed and drafted before, but no concrete implementation has been done so far.

Hmm.. I try it this way. I have a docker-compose file and add --run-once to the watchtower container but doesn't seems to work good. I can't have a restart policy anymore. The container will start, check for updates, and exit. Next time I open my pc the container will be stopped. And if I set a restart policy, docker will restart the container in an infinite loop.

Unfortunately, you won't be able to both have the cake and it at the same time. 😅 To me, it sounds like having it execute with --run-once would be the preferable option. Optionally, you could execute it whenever your computer starts using the appropriate docker-compose command and a line in your .bashrc or equivalent to call it.

@simskij simskij closed this as completed Jul 24, 2023
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

3 participants