在构builddockerfile时运行npm install时出错:npm ERR! git clone git @

在构build我的dockerfile时运行npm install时收到错误。 我不知道为什么会发生这种情况。 当我重新sorting,以便我执行“复制”。 在npm安装之前,它工作。 但我不想这样做,因为我需要重新运行npm安装每一次我重build我的图像和源代码中的每一个小的变化。 有人能告诉我为什么吗? npm安装只需要package.json运行正确? 为什么它看起来也依赖于源代码?

这是我的dockerfile:

# Base docker image FROM debian:sid LABEL name="chrome-headless" \ maintainer="Justin Ribeiro <justin@justinribeiro.com>" \ version="1.4" \ description="Google Chrome Headless in a container" # Install deps + add Chrome Stable + purge all the things RUN apt-get update && apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg \ --no-install-recommends \ && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ && echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \ && apt-get update && apt-get install -y \ google-chrome-stable \ --no-install-recommends RUN apt-get update && apt-get install -y nodejs npm git unzip RUN ln -s /usr/bin/nodejs /usr/bin/node #================== # Chrome webdriver #================== ARG CHROME_DRIVER_VERSION=2.30 RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \ && rm -rf /opt/selenium/chromedriver \ && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ && rm /tmp/chromedriver_linux64.zip \ && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver # Add Chrome as a user RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \ && mkdir -p /home/chrome && chown -R chrome:chrome /home/chrome # Run Chrome non-privileged USER chrome WORKDIR /home/chrome ADD .npmrc .npmrc ADD package.json package.json RUN npm install COPY . . # Autorun chrome headless with no GPU ENTRYPOINT ["/bin/bash", "-c"] 

这是错误信息:

 npm WARN package.json yeti-ui@0.0.0 No repository field. npm WARN package.json yeti-ui@0.0.0 scripts['server'] should probably be scripts['start']. npm WARN package.json yeti-ui@0.0.0 No README data npm WARN deprecated virtual-dom-stringify@3.0.1: use vdom-to-html instead npm WARN optional dep failed, continuing fsevents@1.1.2 npm WARN deprecated virtual-dom-stringify@2.1.0: use vdom-to-html instead npm ERR! git clone git@github.com:github:azer/route-map Cloning into bare repository '/home/chrome/.npm/_git-remotes/git-github-com-github-azer-route-map-d79f36b6'... npm ERR! git clone git@github.com:github:azer/route-map Host key verification failed. npm ERR! git clone git@github.com:github:azer/route-map fatal: Could not read from remote repository. npm ERR! git clone git@github.com:github:azer/route-map npm ERR! git clone git@github.com:github:azer/route-map Please make sure you have the correct access rights npm ERR! git clone git@github.com:github:azer/route-map and the repository exists. npm ERR! notarget No compatible version found: route-map@'github:azer/route-map#44982d8' npm ERR! notarget Valid install targets: npm ERR! notarget ["2.0.0","0.0.1-security","0.0.0","0.0.1","0.1.0","1.0.0"] npm ERR! notarget npm ERR! notarget This is most likely not a problem with npm itself. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! System Linux 4.9.36-moby npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /home/chrome npm ERR! node -v v4.8.3 npm ERR! npm -v 1.4.21 npm ERR! code ETARGET npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.