About to begin my journey of moving a number of my services to Docker containers. Fortunately linuxserver.io already have containers for a lot of them. I’ll probably be using docker-compose to manage the containers, with systemd units created for each one.
Is there some command I can run that, when given a list of docker-compose files, will tell me which of the containers used by those compose files have pending updates?
I’d recommend putting all the containers in the same yaml file.
Than you can do
docker-compose pull and it will pull any image where there is an update.
Then you can do
docker-compose up -d and it will automatically recreate any container where there is an image update (will leave others untouched)
And finally a
docker image prune -f will delete old unused images.
Not sure how you plan on incorporating systemd into the mix, but you don’t have to. As long as you set the restart option in compose yaml, they’ll start on boot and will keep running.
Thanks for the response.
I’m ideally looking for something that will just check whether any updates are available, so that I can send an email notifying me that updates are required, rather than actually carrying out the updates.
Interesting about the restart option. What process runs at boot that enables the docker-compose containers to start automatically?
I believe the docker service handles it, via systemd
Ah ok, wasn’t aware of that. Thanks, will look into it.
Original question about how to write a script that will check for updates and notify me (but not apply them) still applies. Anyone know?
For script, I don’t know but a command will be needed to show differences between images to see if there are any. That may require to download the latest image every time and then make the difference check. That will take some bandwidth depending on size of images and quantity. Like Watchtower container does.
Updates for images like linuxserver/letsencrypt can be twice a day or more in some instances. Because changes don’t have to be huge in order to kickstart a new image creation process.
You can WATCH the github releases of every container for linuxserver and emails will arrive to your inbox. Some twice or more a day mind you. I do and have a rule to go into a mailbox where I look at the updates.
That sounds like it’s probably the simplest method actually. Once I get up and running I’ll do that to start with.
Thanks for the advice.