WatchTower, a docker container updater.

WatchTower, a docker container updater.

So over the weekend, I ended up getting some time to finally take a look at WatchTower.

I have been very curious as to how effective WatchTower would be in my environment, and finally, I got to implement it.

If you don't know what WatchTower is, it's a docker container that updates other running containers as updates become available hence the WatchTower name.

To get it up and running is quite simple as well. I used the following docker-compose to get it up and running;

version: '3'
    image: containrrr/watchtower
    restart: always
      - /var/run/docker.sock:/var/run/docker.sock
      - /etc/timezone:/etc/timezone:ro
      - "com.centurylinklabs.watchtower.enable=true"

Watchtower will then pick up that label and know that it needs to include that docker container (or service) in its updates.

Simply just add the following label to your docker-compose YAML file:

  - "com.centurylinklabs.watchtower.enable=true"

I’ve added a labels attribute and set the parameter that Watchtower looks for when running its update routine. For your containers to be included in Watchtowers update routine you’ll need to add the same labels attribute to ALL of your docker-compose services.

Once you’ve added the labels attribute, simply wait for a new image to be released and within 24 hours your container will have been updated, and restarted and the old image removed (as long as it’s not used elsewhere).