Skip to content

Instantly share code, notes, and snippets.

@oscar230
Created February 14, 2022 22:47
Show Gist options
  • Save oscar230/4dde8ec72f83051fc710022ffd930237 to your computer and use it in GitHub Desktop.
Save oscar230/4dde8ec72f83051fc710022ffd930237 to your computer and use it in GitHub Desktop.
Docker Watchtower, update inclusion by labels.
version: '3'
services:
watchtower:
image: containrrr/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
environment:
WATCHTOWER_CLEANUP: "true"
WATCHTOWER_LABEL_ENABLE: "true"
WATCHTOWER_INCLUDE_RESTARTING: "true"
WATCHTOWER_SCHEDULE: "0,15,30,45 * * * *"
labels:
- "com.centurylinklabs.watchtower.enable=true"
@oscar230
Copy link
Author

Remove the time zone volume and go with this approach, worked for me. Remember to set your time zone correctly. 👍

version: '3'

services:
  watchtower:
    image: containrrr/watchtower
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      WATCHTOWER_CLEANUP: "true"
      WATCHTOWER_LABEL_ENABLE: "true"
      WATCHTOWER_INCLUDE_RESTARTING: "true"
      WATCHTOWER_SCHEDULE: "0,15,30,45 * * * *"
      TZ: "Europe/Stockholm"
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment