Watchtower ignoring disable labels and updating containers anyway #605
|
I have two containers which I do not want to have watchtower auto-updating, so I used the filter flags with the intent of watchtower not updating these containers. An example of how I have deployed these containers is below - jackett:
image: linuxserver/jackett
container_name: jackett
environment:
PUID: '1001'
PGID: '1001'
TZ: GB
network_mode: "service:transmission-openvpn"
volumes:
- /Docker_Configs/Jackett/config:/config
- /media/VMRoot/VMMedia/:/downloads
tty: true
restart: unless-stopped
depends_on:
- "transmission-openvpn"
labels:
- com.centurylinklabs.watchtower.enable = "false"My watchtower deployment is shown below too - watchtower:
image: containrrr/watchtower
hostname: watchtower
container_name: watchtower
network_mode: le_bridge
#environment:
# WATCHTOWER_MONITOR_ONLY: "transmission-openvpn,jackett"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 3600
restart: unless-stopped
Ignore the monitor only section as that has been quoted out. Despite having the above configuration the Jackett container is still updating, this causes a 502 bad gateway error and means all other containers which require access to this container cant really function as intended. I also have a hunch that I may have not interpreted the documentation correctly, should I have the WATCHTOWER_LABEL_ENABLE set to FALSE in the environment variables? I am running Docker 18.06.5 |
Replies: 12 comments 5 replies
|
Hi there, in order for the |
This comment has been hidden.
This comment has been hidden.
|
Although it might have the same result, Example from my version: '3.5'
services:
watchtower:
image: containrrr/watchtower
environment:
TZ: Europe/Amsterdam
WATCHTOWER_POLL_INTERVAL: 300 # Poll interval in seconds
WATCHTOWER_INCLUDE_STOPPED: 1 # Include stopped containers
WATCHTOWER_REVIVE_STOPPED: 1 # Restart stopped containers
WATCHTOWER_CLEANUP: 1 # Delete unused image
WATCHTOWER_LABEL_ENABLE: 1 # Only include containers with enable label
WATCHTOWER_LIFECYCLE_HOOKS: 1 # Enable pre/post-update scripts
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ~/.docker/config.json:/config.json:ro
labels:
com.centurylinklabs.watchtower.enable: true
|
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
|
Correct notation of labels with docker compose v2 is: labels:
com.example.description: "Accounting webapp"
com.example.department: "Finance"
com.example.label-with-empty-value: ""So you should probably use: labels:
com.centurylinklabs.watchtower.enable: "false"See: https://docs.docker.com/compose/compose-file/compose-file-v2/ |
|
I made the changes to the syntax as you have shown last night to jackett:
image: linuxserver/jackett
container_name: jackett
environment:
PUID: '1001'
PGID: '1001'
TZ: GB
network_mode: "service:transmission-openvpn"
volumes:
- /Docker_Configs/Jackett/config:/config
- /media/VMRoot/VMMedia/:/downloads
tty: true
restart: unless-stopped
depends_on:
- "transmission-openvpn"
labels:
com.centurylinklabs.watchtower.enable: "false"And of course my Watchtower looks like this watchtower:
image: containrrr/watchtower
hostname: watchtower
container_name: watchtower
network_mode: le_bridge
environment:
WATCHTOWER_LABEL_ENABLE: 1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 3600
restart: unless-stoppedJackett was again updated last night causing it to 502 error. This has me confused now as surely with the labels set like they are, the container shouldnt be updating? |
This comment has been hidden.
This comment has been hidden.
|
Portainer refuses to deploy it when the quotes are removed, from what I can see, all that adding those flags has done is meant that only Jackett gets updates and my other containers are no longer touched |
|
From what I see in the documentation: So you should remove WATCHTOWER_LABEL_ENABLE: 1 and try again as you changed your label to exclude. https://containrrr.dev/watchtower/arguments/#filter_by_disable_label |
|
There are two ways of doing this, and usually, you'd pick the one which gives you to the least amount of duplication in your config: Exclude everything except when the enable label is set to true: watchtower:
[...]
environment:
WATCHTOWER_LABEL_ENABLE: 1
included:
[...]
labels:
com.centurylinklabs.watchtower.enable: "true"
excluded:
[...]Include everything except when the enable label is set to false: watchtower:
[...]
included:
[...]
excluded:
[...]
labels:
com.centurylinklabs.watchtower.enable: "false" Additional details in https://containrrr.dev/watchtower/arguments/#filter_by_disable_label and https://containrrr.dev/watchtower/container-selection/ If portainer refuses to read common yaml, I'd suggest opening an issue with them. This is perfectly valid when using |
|
What a pain in the a*%e to get this to working, espicially on patching specfic containers. I found a way to get it to work, try this: |
There are two ways of doing this, and usually, you'd pick the one which gives you to the least amount of duplication in your config:
Exclude everything except when the enable label is set to true:
Include everything except when the enable label is set to false:
Additional details in https://containrrr.dev/watchtower/arguments/#filter_by_disable_label and https://containrrr.de…