Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
This is a great tool, thanks for the continued support.
Personally, I don't actually use dockcheck to perform updates, I only use it for its update check functionality, along with a custom plugin which, in cooperation with a python script of mine, serves a REST API that lists all containers on all of my systems with available updates. That then gets pulled into homepage using their custom API function to make something like this: https://imgur.com/a/tAaJ6xf
So at a glance I can see any containers that have updates available, then I can hop into Dockge to actually apply them on my own schedule.
Thank you! Oh! That's pretty cool, do you mind sharing bits of how this is done? Would be nice to incorporate into a notify-template in the future.
Sure, it's a bit hack-and-slash, but not too bad. Honestly the dockcheck portion is already pretty complete, I'm not sure what all you could add to improve it. The custom plugin I'm using does nothing more than dump the array of container names with available updates to a comma-separated list in a file. In addition to that I also have a wrapper for dockcheck which does two things:
Basically there are 5 steps to the setup:
Once running, you should be able to run
curl http://localhost:9323/metrics
and see a dump of Prometheus metricsAt this point you should be able to run your script, and at the end you'll have the file "updatelist.txt" which will either contain a comma-separated list of all containers with available updates, or "None" if there are none. Add this script into cron to run on whatever cadence you want, I use 4 hours.
The neat thing about this program is it's nestable, meaning if you run steps 1-4 independently on all of your Docker servers (assuming you have more than one), then you can pick one of the machines to be the "master" and update the "staturls" variable to point to the other ones, allowing it to collect all of the data from other copies of itself into its own output. If the output of this program will only need to be accessed from localhost, you can change the host variable in app.run to 127.0.0.1 to lock it down. Once this is running, you should be able to run
curl http://localhost:5000/metrics
and see the running and stopped container counts and available updates for the current machine and any other machines you've added into "staturls". You can then turn this program into a service or launch it @reboot in cron or in /etc/rc.local, whatever fits with your management style to start it up on boot. Note that it does verify the age of the updatelist.txt file before using it, if it's more than a day old it likely means something is wrong with the dockcheck wrapper script or similar, and rather than using the output the REST API will print "Error" to let you know something is wrong.