更新管理這件事也變的重要
找到watchtower這個工具 還滿方便使用的
部署方式如下
docker run -d --restart=always \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--cleanup --remove-volumes \
--interval 86400
預設檢查時間是 86400 秒 可視需求調整
如果需要只email通知而不更新
docker run -d --restart=always \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=email \
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=from@example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_TO=to@example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=from@example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=yourpassword \
containrrr/watchtower \
--monitor-only \
--interval 86400 \
沒有留言:
張貼留言