This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
watchtower [2021/09/12 09:59] – alexk7110 | watchtower [2023/10/26 18:35] (current) – updated to docker compose alexk7110 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Watchtower Troubleshooting ====== | ====== Watchtower Troubleshooting ====== | ||
+ | Docker compose deployment | ||
- | Portainer deployment | + | Create a custom template on portainer or a docker-compose.yml |
- | 1. Create new container | + | The WATCHTOWER_CLEANUP environment variable will delete the images that have been updated and the WATCHTOWER_RUN_ONCE will run watchtower, perform the updates and exit, thus giving you control when you want them to happen. |
- | 2. name: watchtower, image: containrrr/ | + | |
- | 3. env: WATCHTOWER_RUN_ONCE=true | + | <code yaml> |
- | 4. vol: / | + | version: " |
- | 5. hit " | + | services: |
+ | | ||
+ | | ||
+ | | ||
+ | environment: | ||
+ | - WATCHTOWER_CLEANUP=true | ||
+ | - WATCHTOWER_RUN_ONCE=true | ||
+ | | ||
+ | - / | ||
+ | - / | ||
+ | </ | ||
- | Run this whenever you are available to upgrade your containers. | + | Run this whenever you are available to upgrade your containers. |
+ | |||
+ | It's wise to add the following label to your portainer or agent compose file so that watchtower only reports whether it needs update without updating it and disrupting the monitoring during the update. | ||
+ | |||
+ | <code yaml> | ||
+ | version: " | ||
+ | services: | ||
+ | portainer: | ||
+ | image: portainer/ | ||
+ | container_name: | ||
+ | labels: | ||
+ | - com.centurylinklabs.watchtower.monitor-only=true | ||
+ | </ | ||
+ | Note that the version has to be 3.3 and up. |