Files
scripts/unraid-1/watchtower.template.xml
matthew 0c35a906ce watchtower: include + revive stopped containers
basement-ui's placeholder image exits immediately, so the container sits
in a Restarting (0) loop. Watchtower's default filter only checks Up
containers, so basement was being silently skipped every cycle —
`scanned=1` in the running watchtower log was actually garage (pinned,
no update available), not basement.

INCLUDE_STOPPED=true makes watchtower check restart-looping / exited
containers too. REVIVE_STOPPED=true starts them after the update so the
new image actually runs. Once a working basement-ui image is pushed,
this combo will pick it up and the container will stop restart-looping.
2026-05-19 08:03:46 -07:00

57 lines
4.2 KiB
XML

<?xml version="1.0"?>
<!--
Unraid Community Apps template for Watchtower (auto-image-updater).
Source of truth: pq/scripts on Gitea (https://git.docker.pq.io/pq/scripts).
Served via gitea raw URL: https://git.docker.pq.io/pq/scripts/raw/branch/main/unraid-1/watchtower.template.xml
This file is NOT installed directly. install.sh fetches it and writes it to
/boot/config/plugins/dockerMan/templates-user/my-watchtower.xml. No secrets
to substitute — Watchtower needs none for these (public) images.
Mirrors the watchtower service on classe (docker-server/docker-compose.yml):
same nickfedor/watchtower:1.17.0 image, same fleet-wide 300s poll interval,
same opt-in via label. The other unraid-1 templates (garage, basement, host-
agent) all carry the enable label, so this container will pick them up.
-->
<Container version="2">
<Name>watchtower</Name>
<Repository>nickfedor/watchtower:1.17.0</Repository>
<Registry>https://hub.docker.com/r/nickfedor/watchtower</Registry>
<Network>bridge</Network>
<MyIP/>
<Shell>sh</Shell>
<Privileged>false</Privileged>
<Support/>
<Project>https://github.com/nicholas-fedor/watchtower</Project>
<Overview>Auto-updates running containers when newer images are published. Opt-in: only watches containers labelled com.centurylinklabs.watchtower.enable=true (garage + basement both carry this).</Overview>
<Category>Tools: Utilities:</Category>
<WebUI/>
<TemplateURL/>
<Icon>https://raw.githubusercontent.com/containrrr/watchtower/main/logo.png</Icon>
<ExtraParams>--restart=unless-stopped</ExtraParams>
<PostArgs/>
<CPUset/>
<DateInstalled/>
<DonateText/>
<DonateLink/>
<Description>
Watches all containers with the label `com.centurylinklabs.watchtower.enable=true` and pulls + restarts them when a newer image tag is published.
Configured identically to the watchtower service on classe (docker-server/docker-compose.yml) so unraid + classe behave the same way:
- polls every 300s (5min — fleet-wide default; gentle on ghcr/dockerhub rate limits)
- cleans up the old image after replacing a container
- opt-in only (WATCHTOWER_LABEL_ENABLE=true) — does NOT touch unlabelled containers
Does not watch itself: a new Watchtower version requires re-Applying this template (or manually pulling).
</Description>
<Config Name="docker.sock" Target="/var/run/docker.sock" Default="/var/run/docker.sock" Mode="rw" Description="Required: lets Watchtower talk to the Docker daemon to inspect and recreate containers." Type="Path" Display="advanced" Required="true" Mask="false">/var/run/docker.sock</Config>
<Config Name="WATCHTOWER_POLL_INTERVAL" Target="WATCHTOWER_POLL_INTERVAL" Default="300" Mode="" Description="Seconds between checks for new images. 300s (5min) is the fleet-wide default — gentle on ghcr/dockerhub rate limits, still effectively instant for new pushes." Type="Variable" Display="always" Required="true" Mask="false">300</Config>
<Config Name="WATCHTOWER_CLEANUP" Target="WATCHTOWER_CLEANUP" Default="true" Mode="" Description="Delete the previous image after a successful update (frees disk)." Type="Variable" Display="always" Required="true" Mask="false">true</Config>
<Config Name="WATCHTOWER_LABEL_ENABLE" Target="WATCHTOWER_LABEL_ENABLE" Default="true" Mode="" Description="Only watch containers with com.centurylinklabs.watchtower.enable=true. Leave true." Type="Variable" Display="always" Required="true" Mask="false">true</Config>
<Config Name="WATCHTOWER_INCLUDE_STOPPED" Target="WATCHTOWER_INCLUDE_STOPPED" Default="true" Mode="" Description="Also check exited / restart-looping containers — needed when a labelled container has a broken/placeholder image that keeps exiting (without this, watchtower silently skips them and never picks up the fixed image)." Type="Variable" Display="always" Required="true" Mask="false">true</Config>
<Config Name="WATCHTOWER_REVIVE_STOPPED" Target="WATCHTOWER_REVIVE_STOPPED" Default="true" Mode="" Description="After updating a stopped container's image, start the container. Pairs with INCLUDE_STOPPED — otherwise watchtower pulls the new image but leaves the container stopped." Type="Variable" Display="always" Required="true" Mask="false">true</Config>
</Container>