Docker 集线器 - 未触发正则表达式匹配的自动构建标签

Docker Hub - Automatic build on tag with regex match not triggered

我正在设置一个存储库来自动部署网络应用程序。

为了管理主分支版本,我在 git 中使用标签来标记每个版本,例如:0.0.40.0.5 等等。

我注意到 docker hub 最近更新了他们的自动构建系统并引入了正则表达式匹配。我想做的是每次将新标签推送到分支时都构建一个图像。

我的问题是,当我在标签和正则表达式上设置新的自动构建时 /^[0-9.]+$/ 没有触发构建?如果我只是在带有最新标签的分支上设置一个自动构建,它就可以正常工作,然后每次我将任何东西推送到分支时,我都会得到一个新的最新构建。

我收到了 docker 中心支持的回复,解决了我的问题:

All newly created automated build repos referencing BitBucket source will be able to have dynamic build triggers based on Git tags.

However, for existing automated build repos, created before 29th December 2015, there is a catch. In order for these existing repos to have tag-based dynamic build triggers, you would need to do either of the following:

The painful way: You will need to remove/delete your automated build repo on Docker Hub and set it up again.

The less painful way: Go to your BitBucket repo settings page (https://bitbucket.org///admin), click on the Services tab under Integration. You should see Docker Hub as one of services listed, likely with an entry that looks like this: POST https://registry.hub.docker.com/hooks/bitbucket. Copy the URL (https://registry.hub.docker.com/hooks/bitbucket) and then click on the Webhooks tab under Integration, then proceed to Add webhook. The title should be "Docker Hub", paste the copied URL in the URL field, tick the "Active" box, and select the "Repository push" option for Triggers. The final configuration should look like the attached screenshot. Last but not least, save the configuration. If you have done either of the above steps, your automated build repo on Docker Hub would trigger new builds when you push any tags to your BitBucket repo.

我刚刚完成了设置示例存储库的过程。对我来说,自动设置不起作用。我必须做的是在 GitHub 上将 Docker 服务添加到我的回购协议中,我所有的推送都会自动开始触发构建。

对于 GitHub 我必须执行以下操作

  • 登录 hub.docker.com 并导航到适当的存储库,例如 Fluentd - papertrail

  • 转到 GitHub 并导航到您要从中构建的存储库

    • 转到回购的设置,然后Webhooks
    • 单击 添加 webhook 并将 触发器 URL 从 docker 中心粘贴到 Payload URL 框,然后单击底部的 Add webhook
    • 请注意,您可能希望 select 单个事件并将它们限制为提交、标记等