Skip to content

Watchtower

Homepage | Repository

A process for automating Docker container base image updates.

Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.

inventories/homelab/group_vars/homelab.yml
watchtower_enabled: true

Watchtower will automatically monitor and update all other Docker containers.

See the default configuration options for Watchtower at roles/watchtower/defaults/main.yml. Add any overrides to your inventories/[your_inventory]/group_vars/homelab.yml file.

Watchtower can publish metrics (containers scanned/updated/failed/skipped, scan counts) to Prometheus for monitoring. This requires prometheus_enabled: true.

Enable it and set a bearer token Prometheus uses to authenticate — generate one with openssl rand -hex 32:

inventories/homelab/group_vars/homelab.yml
watchtower_metrics_enabled: true
watchtower_metrics_token: "your-generated-token"
watchtower_ephemeral_self_update_enabled: true

Then import the dashboard from the Watchtower repo’s examples/metrics/grafana/dashboards/dashboard.json to visualize the data.