# Mise-à-jour des containers ### Container manager ##### Onglet Image: Notifications pour les images dont: - source: hub.docker.com - tag: Latest ou Nightly Cliquer sur 'Update available': l'image est téléchargé et le container mis-à-jour/ ##### Onglet Projet: Si il y a plusieurs containers dans le Projet: - sélectionner le Projet -> Action -> Arrêt - mettre à jour les images - sélectionner le Projet -> Action -> Créer ### Watchtower | Création | Portainer | | ----------- | ---------- | | Mise-à-jour | Watchtower | | Ports | 8000/9000 | https://drfrankenstein.co.uk/watchtower-automated-updates-in-container-manager-on-a-synology-nas/ ```yaml version: '2.1' services: watchtower: image: containrrr/watchtower container_name: watchtower hostname: watchtower-nas network_mode: bridge environment: - WATCHTOWER_NOTIFICATIONS=email - WATCHTOWER_CLEANUP=true - WATCHTOWER_DEBUG=true - WATCHTOWER_LABEL_ENABLE=true - WATCHTOWER_TIMEOUT=30s - WATCHTOWER_POLL_INTERVAL=300 - TZ=Europe/Paris env_file: - stack.env labels: - "com.centurylinklabs.watchtower.enable=true" volumes: - /var/run/docker.sock:/var/run/docker.sock - /volume1/docker/watchtower/config.json:/root/.docker/config.json restart: unless-stopped ``` ##### Mettre-à-jour seulement les containers spécifiés: A ajouter dans le compose de watchtower: ```yaml environment: - WATCHTOWER_LABEL_ENABLE=true ``` A ajouter aux containers que l'on souhaite mettre-à-jour: ```yaml labels: - "com.centurylinklabs.watchtower.enable=true" ``` ##### Uniquement monitorer certains containers: A ajouter aux containers que l'on souhaite suivre: ```yaml labels: - "com.centurylinklabs.watchtower.monitor-only=true" ``` ##### Monitorer et mettre-à-jour seulement certains containers: A ajouter dans le compose de watchtower: ```yaml environment: - WATCHTOWER_DISABLE_CONTAINERS=container1,container2 ``` https://www.smarthomebeginner.com/watchtower-docker-compose-2024/ #### Lancer Watchtower manuellement: ```bash $ docker run -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once ``` #### Notifications: https://containrrr.dev/watchtower/notifications/