Automatically update docker images with Watchtower

Written by / Original link on Jun. 15, 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.


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

More documentation is available here.


« A Week of Symfony #650 (10-16 June 2019) - Decoupling releases from deploys using feature flags »