首页 > 解决方案 > gnutls_handshake() 失败:关闭通知 - Docker 且仅在一个网络上

问题描述

刚刚遇到一个非常奇怪的问题。

我一直在使用 Docker 映像和 Dockerfile 进行一些工作,其中包括一些 bower 安装命令。一切都很好,直到今天我有了一个新的宽带提供商(英国的 Virgin Media),突然间我开始在尝试构建图像时遇到错误,例如

bower ember#1.13.12                        ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/components/ember.git", exit code of #128 fatal: unable to access 'https://github.com/components/ember.git/': gnutls_handshake() failed: Close notify

Additional error details:
fatal: unable to access 'https://github.com/components/ember.git/': gnutls_handshake() failed: Close notify


然后我尝试连接到我的手机(4g),它工作得很好。所以 bower.json 中有很多命令,它似乎随机失败。

即使是像从 Dockerfile 中克隆 repo 这样的简单命令,当我连接到我的新网络但与其他网络一起使用时也会失败。

奇怪的是,如果我在我的 Mac 上使用 git clone 命令,甚至使用完全相同的 repo 安装 bower,它都可以正常工作(使用新网络和 4G),但是一旦我尝试通过 Dockerfile 运行,我就会得到错误。

我检查了我的路由器,但无法真正看出它是否是路由器问题。WIFI信号是200Mbs,所以肯定不可能。

标签: node.jsdocker

解决方案


由于 git 使用的协议而引发错误。只需将“https”替换为“http”,它适用于我的情况。


推荐阅读