PHPnews.io

Automatically update docker images with Watchtower

Written by jenssegers.be / Original link on Jun. 16, 2019

Yesterday I ran across an interesting tool for Docker called Watchtower. It runs in the background and monitors your running Docker containers for images updates. If a new image is found, it pulls it and restarts the container with the exact same configuration as it was started. Optionally it can also remove the old container image to save up some disk space.

68747470733a2f2f30783132622e636f6d2f7761746368746f7765722d6c6f676f2e706e67

Looking at the number of stars the GitHub repository has, I'm late to the party...

I'm running this on my personal server now which will hopefully replace the need of running my Ansible scripts once in a while to update all images to the latest version.

Try it out:

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    containrrr/watchtower --cleanup

You can run it for all containers or for a select set of containers. More documentation is available here.

jenssegers

« Decoupling releases from deploys using feature flags - Timelapse of the future »