Watchtower
Install
#Docker Compose for Watchtower version: "3" services: watchtower: image: containrrr/watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc/timezone:/etc/timezone:ro environment: # Clean up older container. - WATCHTOWER_CLEANUP=true # Labels which the tower looks over. - WATCHTOWER_LABEL_ENABLE=true # Restarting - WATCHTOWER_INCLUDE_RESTARTING=true labels: # Update itself - "com.centurylinklabs.watchtower.enable=true"
This is a docker compose we made.
Notifications
Incase you need WatchTower to send Notifications, here is an example command that sets the environmental variables:
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=email \
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddress@gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_TO=toaddress@gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=fromaddress@gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \
-e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2 \
containrrr/watchtower