[英]Docker + Nodejs + Private Repo + Private NPM Module - Access Problems
[英]Docker NPM Cannot get private module / repo from Github
我尝试构建 docker 映像,但无法从 Github 中提取私有模块。 I am using https in my package.json but when doing docker build ssh is used, I don't know why...
"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 而不是
RUN git config --global url."https://github.com/".insteadOf git@github.com:
RUN git config --global url."https://".insteadOf git://
但是,我仍然没有让它工作......
在您的 docker 容器中,您需要运行 ssh-keyscan 并将其添加到 ssh 已知主机
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan -H github.com > /root/.ssh/known_hosts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.