Sign inSign up

pqguanyinli/watchtower

By pqguanyinli

•Updated about 1 year ago

watchtower:latest-dev

Image
0

172

pqguanyinli/watchtower repository overview

⁠⚜️ Watchtower ⚜️ 是一款轻量级、开源的容器管理工具,专门用于 Docker 容器镜像的更新自动化。

⁠🚩 基本用法

docker run --rm --name watchtower -v /var/run/docker.sock:/var/run/docker.sock pqguanyinli/watchtower:latest-dev --include-stopped --cleanup --run-once 容器1 容器2 容器3 ...
⁠⬆️ 解释:watchtower 自动更新指定的容器,包含更新停止状态的容器,运行一次更新后自动清除旧镜像并删除Watch­tower容器。将上面语句加入到计划任务中,实现定时更新指定的docker镜像。

⁠🚩 常用参数

--remove-volumes #清理匿名卷

--cleanup #清理标签为none的镜像,可以简写为 -c

--run-once #只运行一次,可以简写为 -R

--include-stopped #包含停止状态的容器,这样就不必在每次更新的时候要先把容器打开了

--revive-stopped #只能在上一个指令使用以后才可以使用,表示将未启用的容器更新后自动启动

--interval \<seconds> #设置 Watchtower 轮询检查更新的时间间隔,默认是 300 秒。简写为 -i

--schedule "0 0 2 * * *" #设置定时检测更新时间,可简写为-s。比如每天凌晨2点检查一次更新:--schedule "0 0 2 * * *"

--monitor-only #将仅监控新镜像并发送通知,不会更新容器。

--label-enable #仅更新容器中加入“--label com.centurylinklabs.watchtower.enable=true”参数的容器,可简写为-e

--no-pull #禁止 Watchtower 拉取新的镜像

--no-restart #禁止 Watchtower 重启容器

⁠🚩 举个例子

docker run --rm --name watchtower -v /var/run/docker.sock:/var/run/docker.sock pqguanyinli/watchtower:latest-dev --include-stopped --cleanup --run-once  navidrome xiaoya

Tag summary

Content type

Image

Digest

sha256:135de872d…

Size

10.4 MB

Last updated

about 1 year ago

docker pull pqguanyinli/watchtower:latest-dev