构建docker映像,使用内置映像ID标记,推送映像

时间:2018-10-26 11:17:48

标签: docker kubernetes google-kubernetes-engine

背景:在Google Cloud上运行Kubernetes。

因为Kubernetes不能容忍for i in list: r = request.post(url, values) #posts the values if 'id=correct' in open('output.txt').read(): #check if it works print("logged in") #if it works, it would print this, if not, #it will retry with the next element in the list 标签进行滚动更新,所以我会发现类似的东西有用。

:latest

我看到了一篇有关使用git commit hash作为标记的博客文章。还有其他替代方法可以跳过“复制git hash步骤”吗?

谢谢

2 个答案:

答案 0 :(得分:0)

根据Kubernetes documentations

“从image:latest滚动更新到新的image:latest将失败,即使该标记处的图像已更改也是如此。而且,不建议使用:latest。”

他们提供了一些配置方面的最佳实践以提供帮助,您可以在以下link中进行检入并作为指南。

答案 1 :(得分:0)

根据丹尼斯的回答。我知道了,应该可以完成工作。

docker build . -t gcr.io/project/nginx:$(git rev-parse --short HEAD) && docker push gcr.io/project/nginx:$(git rev-parse --short HEAD)

相关问题