我有一个可以工作的Dockerfile,直到一天前它看起来好像坏了。我没有对我的依赖项做任何更改--但是我得到了以下错误:
[91mnpm ERR! code ENOGIT
[0m
[91mnpm ERR! No git binary found in $PATH
npm ERR!
npm[0m
[91m ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
[0m
[91m
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-09-28T21_12_50_050Z-debug.log
[0m
Removing intermediate container be9d5bfe5521
The command '/bin/sh -c npm install' returned a non-zero code: 1
这非常奇怪,因为这是以前没有发生过的。我还附上了我的Dockerfile。到目前为止,我已经尝试了添加git (第三行),并尝试导出路径。似乎什么都不起作用。
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y git
FROM node:alpine
RUN npm install sails -g
#RUN npm install git -g
#RUN export PATH="$HOME/usr/bin/git:$PATH"
RUN mkdir -p /service/app
WORKDIR /service/app
COPY package.json /service/app
RUN npm install
COPY . /service/app
EXPOSE 80
CMD NODE_ENV=production sails lift
https://stackoverflow.com/questions/46478626
复制相似问题