MirrorNest
← Tous les guides

Watchtower

A free, open-source tool that watches your running Docker containers and automatically pulls + restarts them when a new image version is published -- keeps self-hosted apps patched without manual `docker pull` runs.

Système : Any Docker hostUtilitiesDockerAutomationSite officiel ↗Documentation officielle ↗
Ce guide est élaboré à partir de la documentation officielle de Watchtower, dont le lien figure ci-dessus — vérifiez toujours les noms exacts des paquets/versions avant d'exécuter ces commandes sur un serveur de production, car les versions de la distribution et du projet évoluent avec le temps.
  1. 1Run Watchtower

    docker run -d \ --name watchtower \ --restart unless-stopped \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower

    With no extra flags, Watchtower checks every running container every 24 hours and updates all of them -- see the next step to scope this down.

  2. 2Limit it to specific containers (recommended)

    Pass container names as arguments so only those get auto-updated -- safer than blanket-updating everything, especially anything with a database that needs a manual migration step on major version bumps.

    docker run -d \ --name watchtower \ --restart unless-stopped \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower \ uptime-kuma portainer
  3. 3Set a custom check interval

    In seconds -- 3600 checks hourly instead of the 24-hour default.

    docker run -d ... containrrr/watchtower --interval 3600