【发布时间】:2020-12-09 04:34:38
【问题描述】:
我尝试构建一个 docker 镜像,但我无法从 Github 中提取私有模块。我在 package.json 中使用 https,但是在使用 docker build ssh 时,我不知道为什么...
"dependencies": {
"my-pkg": "git+https://GITHUB_TOKEN:x-oauth-basic@github.com/myuser/my-pkg.git#tag
},
docker 构建错误
#9 33.09 npm notice
#9 33.10 npm ERR! code 128
#9 33.10 npm ERR! command failed
#9 33.10 npm ERR! command git ls-remote ssh://git@github.com/myuser/my-pkg.git
#9 33.10 npm ERR! Host key verification failed.
#9 33.10 npm ERR! fatal: Could not read from remote repository.
#9 33.10 npm ERR!
#9 33.10 npm ERR! Please make sure you have the correct access rights
#9 33.10 npm ERR! and the repository exists.
我尝试在我的 Dockerfile 中包含 git insteadOf
RUN git config --global url."https://github.com/".insteadOf git@github.com:
RUN git config --global url."https://".insteadOf git://
但是,我还是没有让它工作......
【问题讨论】:
标签: node.js git docker github npm