-1
複製當試圖NPM安裝,我得到錯誤:NPM SSH誤差不從外殼
1206 error node v0.12.0
1207 error npm v2.7.4
1208 error code 128
1209 error Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://[email protected]/schematist-postgres.git /root/.npm/_git-remotes/ssh-git-git-spindle-factfiber-com-schematist-postgres-git-8e4b2071
1209 error ssh: Could not resolve hostname git.spindle.factfiber.com: Name or service not known
然而,當我嘗試了很命令從shell報道:
git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://[email protected]/schematist-postgres.git /root/.npm/_git-remotes/ssh-git-git-spindle-factfiber-com-schematist-postgres-git-8e4b2071
它的工作原理:
Cloning into bare repository '/root/.npm/_git-remotes/ssh-git-git-spindle-factfiber-com-schematist-postgres-git-8e4b2071'...
remote: Counting objects: 47, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 47 (delta 20), reused 0 (delta 0)
Receiving objects: 100% (47/47), 13.05 KiB, done.
Resolving deltas: 100% (20/20), done.
我試過這幾次,以防萬一它是一個臨時DNS故障。有誰知道會發生什麼?
UPDATE:當我創建一個新的回購和
npm install git+ssh://[email protected]:schematist-postgres.git
那麼,一旦失敗,第二次成功。無論哪種方式npm需要很長時間(20-30秒?),而殼牌git
成功只需一秒鐘。
這是一個碼頭圖像,順便說一句。我決定把一些命令行工具投入到一個圖像(screen,jove)和重建 - 在構建好之前,但仍然需要很長時間。所以我不認爲只包括那些軟件包就是問題所在。問題可能是一些DNS配置錯誤?但是,如果是這樣,爲什麼它是特定的npm?
UPDATE - Dockerfile。這是正在興建的MAC /約塞米蒂
FROM debian:wheezy
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl wget \
openssh-client build-essential unicode-data screen jove
# ------------------------------------------------
# node
RUN curl -sL https://deb.nodesource.com/setup_0.12 | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
RUN npm install -g coffee-script && npm -g install [email protected]
# ------------------------------------------------
# git
# setup keys so we can pull from github
# mounted "sw-pull-rsa" contains key
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git
ADD ./sw-pull-rsa /root/.ssh/id_rsa
ADD ./sw-pull-rsa.pub /root/.ssh/id_rsa.pub
RUN chmod 0600 /root/.ssh/id_rsa
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN ssh-keyscan git.spindle.factfiber.com >> /root/.ssh/known_hosts
# ------------------------------------------------
RUN npm install -g npm
RUN npm install -g npm-cache
RUN mkdir -p /tmp/common
COPY ./common/package.json /tmp/common/
RUN cd /tmp/common && npm install
你可以發佈一個複製器,或者至少是你的Dockerfile嗎?在apt-get install之前,你是否總是執行'apt-get update'? – user2915097 2015-03-31 10:40:18
我在安裝之前執行'apt-get update',但不是在每次安裝之前。我需要嗎?我也可以整合安裝npm和git。第一部分實際上是一個基本的Dockerfile,我用它來做一些不同的事情。 – shaunc 2015-03-31 23:35:53