『中级篇』Docker Cloud自动构建 Docker image(55)

>原创文章,欢迎转载。转载请注明:转载自IT人故事会,谢谢!
>原文链接地址:『中级篇』Docker Cloud自动构建 Docker image(55)

一步一步的接近下面这个图,来通过时间的方式github,自动构建成docker image吧

『中级篇』Docker Cloud自动构建 Docker image(55)

登录docker cloud

可以通过docker账号登录。

『中级篇』Docker Cloud自动构建 Docker image(55)

跟github进行关联

这个是根据自己的账号来进行的我的是:https://cloud.docker.com/swarm/zhugeaming/settings

  1. 进入person的设置

『中级篇』Docker Cloud自动构建 Docker image(55)

  1. github设置授权

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

github和docker cloud已经关联完毕

『中级篇』Docker Cloud自动构建 Docker image(55)

关联完毕

『中级篇』Docker Cloud自动构建 Docker image(55)

创建一个构建关系

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

这部可以直接skip跳过

『中级篇』Docker Cloud自动构建 Docker image(55)

创建成功

转移到新的dockercloudtest

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

创建成功已经有命令

『中级篇』Docker Cloud自动构建 Docker image(55)

github之间进行关联build

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

选择对应Dockfile的路径,记住是路径

『中级篇』Docker Cloud自动构建 Docker image(55)

更改成路径

『中级篇』Docker Cloud自动构建 Docker image(55)

点击save进入这个页面,点击trigger

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

第一次build 是成功的, 之后有失败的情况,因为毕竟是免费的用的是公共的资源池,需要排队,可能紧张的话难免失败,创建build也需要等待的一段时间。

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

自动build

开启按钮,修改Dockerfile保存后自动创建。

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

自动执行了。

『中级篇』Docker Cloud自动构建 Docker image(55)

github增加release分支加入tag

先告诉大家如何打tag

  1. 新建立release

『中级篇』Docker Cloud自动构建 Docker image(55)

  1. 点击ceate a new release

『中级篇』Docker Cloud自动构建 Docker image(55)

  1. 点击创建成功

    下面这个图应该吧1.0改成1.0.0这种规则。应该下面有build的时候定义tag的规则。

『中级篇』Docker Cloud自动构建 Docker image(55)

  1. 点击完毕

『中级篇』Docker Cloud自动构建 Docker image(55)

  1. 点击修改docker cloud 修改

『中级篇』Docker Cloud自动构建 Docker image(55)

  1. 添加build规则

tag规则要跟一致

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

开始等待发现了。

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

『中级篇』Docker Cloud自动构建 Docker image(55)

hub.docker.com 里面也有

『中级篇』Docker Cloud自动构建 Docker image(55)

PS:自动化构建的build image,是不是感觉很爽,但是这里的Dockfile这是需要基础牢靠。本节也是以后学习的基础。

『中级篇』Docker Cloud自动构建 Docker image(55)

猜你喜欢

转载自blog.51cto.com/12040702/2282114