docker autobuild与git私有子模块 [英] docker autobuild with git private submodule

查看:282
本文介绍了docker autobuild与git私有子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GitHub上有两个私有存储库,名为 dashboard ui 。我将 ui 定义为 dashboard 的git子模块,并将Docker配置为autobuild dashboard 在特定分支上的每个更改。



我阅读了这个文档 https://docs.docker.com/docker-hub/builds/ ,但是当我尝试在我的 ui 中设置docker给出的部署密钥时, code>的设置,它说密钥已经在使用。确实,这个密钥已经被 dashboard 使用,以便docker自动建立这个repo!



这是我的docker build日志:


错误:

 无法克隆资料库:克隆到'/ tmp / build_byaxhis7sznbvmb6wgwzm6n'... 
注册了子模块'app / styles / ui'(git@github.com:yllieth / ui.git)路径'app / styles / ui'
克隆到'app / styles / ui'...


警告:永久添加'github.com,192.30.252.130'( RSA)到已知主机的列表。
错误:找不到存储库。
致命:远程端点意外挂起
将git@github.com:yllieth / ui.git克隆到子模块路径app / styles / ui失败

Dockerfile:


Docker没有找到任何Docker文件,即使我在我的仪表板 repo中定义了一个。所以,我将无法给出任何说明或添加另一个SSH密钥。



如果任何人有关于如何使用autobuild与private repos和git子模块的想法,我有兴趣!!

解决方案

如果您的GitHub存储库包含指向私有子模块的链接,您将收到一条错误消息建立。通常,Docker Hub在您的GitHub存储库中设置了一个部署密钥。不幸的是,GitHub只允许存储库部署密钥访问单个存储库。作为解决方法,您需要在GitHub中创建一个专用的用户帐户,并将自动化版本的部署密钥附加到该帐户。这个专用的构建帐户可以被限制为只需要构建所需的存储库只读访问



一个人已经启动了停靠点文档中的更新。
他还包括可能会帮助您解决此问题的截图。


I have two private repositories on GitHub called dashboard and ui. I defined ui as a git submodule of dashboard, and I configured docker to autobuild dashboard on every changes on a specific branch.

I read this documentation https://docs.docker.com/docker-hub/builds/, but when I try to setup the deploy key given by docker in my ui's settings, it says "Key already in use". Indeed, this key is already used by dashboard to allow docker to autobuild this repo!

Here is my docker build log:

Error:

Failed to clone repository: Cloning into '/tmp/build_byaxhis7sznbvmb6wgwzm6n'...
Submodule 'app/styles/ui' (git@github.com:yllieth/ui.git) registered for path 'app/styles/ui'
Cloning into 'app/styles/ui'...


Warning: Permanently added 'github.com,192.30.252.130' (RSA) to the list of known hosts.
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
Clone of 'git@github.com:yllieth/ui.git' into submodule path 'app/styles/ui' failed

Dockerfile: None

Docker doesn't find any Dockerfile even if I have one defined in my dashboard repo. So, I won't be able to give it any instructions or add another SSH key.

If anyone has an idea about how using autobuild with private repos and git submodule, I'm interested!!

解决方案

If your GitHub repository contains links to private submodules, you'll get an error message in your build. Normally, the Docker Hub sets up a deploy key in your GitHub repository. Unfortunately, GitHub only allows a repository deploy key to access a single repository. As a workaround, you need to create a dedicated user account in GitHub and attach the automated build's deploy key to that account. This dedicated build account can be limited to read-only access to just the repositories required to build.

A guy already initiated the pull request for the update in docker document. He also included the screenshots that might help you with this problem.

这篇关于docker autobuild与git私有子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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