Skip to main content

moon

 · 

查看 Kamal 当前部署的版本和时间

快速查看服务器上正在运行的版本,以及它是什么时候部署上线的。

核心命令

bin/kamal app details

列出每台 host 上容器的 image、container ID、以及 STATUS 字段。STATUS 里会显示 "Up 3 hours" 或 "Up 2 days" 这样的相对时间——部署了多久一目了然。

bin/kamal app version

输出当前运行的 git commit SHA(Kamal 默认用 commit SHA 作为镜像 tag)。

拿到 SHA 之后

git show <sha> --stat

看到这个版本对应的提交信息、作者、日期、以及改动的文件列表。有时候发现服务器上跑的是几天前的版本,和 main 差了好几个 commit,马上就知道该不该重新 deploy 了。

其他补充命令

精确的启动时间戳:

bin/kamal app exec --reuse "date -r /proc/1"

看最近 pull 过的镜像(粗略的部署历史):

bin/kamal app exec --reuse "docker image ls <your-image-name>"

小结

日常最常用的就是 bin/kamal app details 一条——版本、状态、启动时长全都有。

Download Pickful App

Better experience on mobile

iOS

Android

APK