我如何检查我的本地docker映像是否已过时,而不从其他地方推送? [英] How do I check if my local docker image is outdated, without pushing from somewhere else?

查看:130
本文介绍了我如何检查我的本地docker映像是否已过时,而不从其他地方推送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Coreos服务器上的docker容器中运行react应用.假设它是从https://hub.docker.com/r/myimages/myapp的dockerhub中拉出的.

现在,我想定期检查app容器的dockerhub映像是否已更新,以查看我在本地运行的映像是否在后面.

与远程映像相比,检查本地docker映像是否过时的最有效方法是什么?到目前为止,我发现的所有解决方案都是bash脚本或可推动更新的外部服务.我想找到一个尽可能多于docker原生的解决方案,并且希望避免从其他地方推送通知(向服务器发送更新映像的警报).

解决方案

如果您使用的是Docker Hub,则可以使用Webhook通知Docker主机有关更新的信息,并对此采取措施.

使用webhook是做到这一点的简单"方法(我认为),否则,您将不得不在docker pull中进行某种爬网,或者像@alebianco解释的那样比较一些哈希或构建/创建日期./p>

以下是有关此文档的文档: https://docs.docker.com/docker -hub/webhooks/

I'm running a react app in a docker container, on a Coreos server. Let's say it's been pulled from dockerhub from https://hub.docker.com/r/myimages/myapp.

Now I want to check periodically if the dockerhub image for the app container has been updated, to see if the image I'm running locally is behind.

What would be the most efficient way to check if a local docker image is outdated compared to the remote image? All solutions I've found so far are bash scripts or external services that push on an update. I'd like to find a solution that is as native to docker as possible, and would like to refrain from pushing a notification from somewhere else (to alert the server of an updated image).

解决方案

If you are using Docker Hub you could use a Webhook to notify the docker host about a update, and take action over that.

Using the webhook would be the "simple" way to do it (I think) otherwise you would have to do some kind of crawling in the docker pull or as explained by @alebianco comparing some hashs or build/creation dates.

Here is the docs about it: https://docs.docker.com/docker-hub/webhooks/

这篇关于我如何检查我的本地docker映像是否已过时,而不从其他地方推送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆