我正在尝试从Github私有存储库在Docker Hub上创建一个自动构建。
但我仍然有一个错误。我不确定它是否与SSH密钥或gitmodules有关。
这是我得到的日志(在我的Docker Hub仓库中的Build Details选项卡中):
Starting to clone
Cloning into 'bsntx4mjvrqncsdvzcn7tqp'...
Warning: Permanently added the RSA host key for IP address 'XXX.XX.XX.XX' to the list of known hosts.
No submodule mapping found in .gitmodules for path 'vendor/bundle/ruby/2.1.0/bundler/gems/logan-3722sdf9a9db5'
please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (1)
有没有人有同样的错误?
我的解决方案:我已经通过删除我的github仓库中的文件vendor / bundle / ruby / 2.1.0 / bundler / gems / logan-3722sdf9a9db5解决了我的问题。所以关于公钥的错误与它无关。
问题不在于密钥。
我不知道确切的问题。您可以使用以下命令对问题进行排序。
git submodule update --init
命令的输出将传递给
git rm --cached {{output}}
推送提交。
我无法发表评论,所以我将其作为“答案”发布(抱歉!)
我和Bitbucket有同样的问题,它无法从我的主要仓库中包含的子模块中获取。我还没能解决这个问题。我甚至支付了付费订阅并在hub.docker中添加了一个自动构建,希望能解决这个问题,但是没有...
Starting to clone
Cloning into 'bokyrk3hkhspby5smhf6kby'...
Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx' to the list of known hosts.
Submodule 'lib/shared' (https://[email protected]/xxx/xxx_sharedlibs.git) registered for path 'lib/shared'
Cloning into 'lib/shared'...
fatal: could not read Password for 'https://[email protected]': No such device or address
Clone of 'https://[email protected]/xxx/xxx_sharedlibs.git' into submodule path 'lib/shared' failed
please ensure the correct public key is added to the list of trusted keys for this repository and the remote branch exists. (1)
以下程序让我开始工作:
通过git bash将我的私钥添加到本地ssh。将我的公共SSH密钥添加到github。这个ssh密钥已在我的dockerhub中提供。因此,我将另一个公共dockerhub userid(其中自动构建成功)链接为此私有自动构建的协作者。
对于私有仓库的工作,您应该将Docker Hub中的ssh密钥(在添加自动构建时显示)添加到您的github ssh密钥。
当自动构建失败时,构建细节顶部的橙色警报可能有点欺骗:
构建失败:请确保将正确的公钥添加到此存储库的可信密钥列表中,并且存在远程分支。 (128)
即使您设置了ssh键,也会显示此消息。如果您知道已经为私有仓库设置了ssh密钥,则需要查看构建详细信息底部的日志以查看更多信息。
例如,您的日志可能会说:
致命:在.gitmodules中找不到路径'my-app / my-blog'的子模块映射
或者它可能是
在./my-app/Dockerfile中找不到Dockerfile
在您的情况下,您遇到的问题与解决方案中需要删除的文件vendor/bundle/ruby/2.1.0/bundler/gems/logan-3722sdf9a9db5
有关。