在 docker 构建期间无法关闭私人仓库
unable to close private repo during docker build
我 运行 遇到了一个有趣的问题……
我需要在 docker 构建期间克隆私有 git 存储库。为此,我使用 build-arg 将本地 machine (mac pro) 中的 ssh 密钥传递到图像中。密钥已添加到 git。此过程在本地有效。
我现在正在尝试使用 ubuntu 虚拟机作为 docker 主机来复制此过程。我已经生成密钥并且能够连接到 git 并从 ubuntu 主机的 repo 克隆。但是,在 docker 构建过程中传递密钥时会出错。 docker 图片是 node:9
任何人都知道是什么原因造成的?
npm ERR!
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
(已编辑)`
已解决!
在 ~/.ssh/ 下创建了配置文件
主持人<url>
用户git
StrictHOstKeyChecking 否
我 运行 遇到了一个有趣的问题……
我需要在 docker 构建期间克隆私有 git 存储库。为此,我使用 build-arg 将本地 machine (mac pro) 中的 ssh 密钥传递到图像中。密钥已添加到 git。此过程在本地有效。
我现在正在尝试使用 ubuntu 虚拟机作为 docker 主机来复制此过程。我已经生成密钥并且能够连接到 git 并从 ubuntu 主机的 repo 克隆。但是,在 docker 构建过程中传递密钥时会出错。 docker 图片是 node:9
任何人都知道是什么原因造成的?
npm ERR!
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
(已编辑)`
已解决!
在 ~/.ssh/ 下创建了配置文件
主持人<url>
用户git
StrictHOstKeyChecking 否