Repository navigation
Replies: 1 comment
|
Thank you for opening the discussion after #1773. I retain my position that Watchtower will never run a command taken from a container label against the underlying host. That would let any container that Watchtower updates execute a command with Watchtower's privileges. Likewise, it is inappropriate to expect monitored containers to operate with the security context necessary to perform host-level management operations (i.e. executing backups) prior a Watchtower update. The best solution, given the security constraints, is to use a separate script/program that orchestrates the check -> backup -> update process and leverages Watchtower's HTTP API to trigger actions, such as checking for updates and performing update operations. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Watchtower's lifecycle hooks currently run inside the container being updated.
This is nice when running e.g.
mysqldumpinside the container to do backups, but it works poorly when trying to do backup logic on host-level (or inside the watchtower container, for most people who just use the pre-built container image). I'm using LVM snapshots before updating a container, since they're like an instant operation with almost no overhead and you can also go back instantly.People already try to workaround this limitation by implementing spooky bind mounts and breakout scripts like the synology-stop.
My goal would be to have a host-pendant to every current hook like
which executes the script on the host.
Additionally it would be nice to have a completely new hook here at this point in lifecycle:
With this you could implement a completely generic backup script that basically does:
I already suggested a solution in PR #1773, which works for me since, but let's have a discussion to implement this here upstream.
All reactions