【发布时间】:2016-11-23 06:25:17
【问题描述】:
我猜这是一个互联网连接问题,但是,可能缺少一些 RSA 公钥。
我有这个 Dockerfile:
FROM node:4-onbuild
COPY test-install-post-publish.sh /usr/src/app/
EXPOSE 8888
复制到容器中的 bash 脚本如下所示:
#!/usr/bin/env bash
cd # cd to home dir
mkdir suman-test
cd suman-test &&
rm -rf suman-test-projects &&
git clone git@github.com:sumanjs/suman-test-projects.git &&
cd suman-test-projects &&
./test-all.sh
我运行容器,我得到了这个:
npm info it worked if it ends with ok
npm info using npm@2.15.11
npm info using node@v4.6.2
npm info prestart installation@1.0.0
npm info start installation@1.0.0
> installation@1.0.0 start /usr/src/app
> ./test-install-post-publish2.sh
Cloning into 'suman-test-projects'...
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
npm info installation@1.0.0 Failed to exec start script
npm ERR! Linux 4.4.27-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.6.2
npm ERR! npm v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! installation@1.0.0 start: `./test-install-post-publish2.sh`
npm ERR! Exit status 128
npm ERR!
npm ERR! Failed at the installation@1.0.0 start script './test-install-post-publish2.sh'.
npm ERR! This is most likely a problem with the installation package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./test-install-post-publish2.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs installation
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls installation
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/app/npm-debug.log
所以看起来容器可以“连接到互联网”,但它很糟糕,因为它没有所需的 RSA 信息。 但是这是一个公共回购!为什么 Github 要求提供 SSH 密钥和东西?
有人知道会发生什么吗?怎么修?我确定这是一个公开的 Github 存储库,如果您愿意,可以自己查看。
【问题讨论】:
-
也许我应该只使用 HTTPS 而不是 SSH ?但是,为什么上面呢?以及如何解决。
标签: node.js bash github docker dockerfile