最近,我使用Docker的Heroku Review Apps停止了构建。它们以前的行为符合预期,但是现在看来npm在PATH上找不到git。
我的第一个猜测是由于某种原因,我现在需要在git-alpine中安装git。请参阅下面的尝试,其中添加了“RUN npm install --no-cache git”
任何帮助,将不胜感激!我也非常想知道为什么它表现出预期。
Dockerfile-heroku
FROM node:carbon-alpine
WORKDIR /usr/app
COPY . .
# Build Angular
RUN npm install --no-cache git
RUN npm install
RUN npm run build
WORKDIR ./server
# Build Webserver
RUN npm install
RUN npm run build
CMD ["node", "./bin/www"]
错误信息
Step 4/9 : RUN npm install
---> Running in f8800495a4ab
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-12-28T13_15_27_080Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
最佳答案
关于git - 如何使用Docker在Heroku Review App中的PATH上获取GIT?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53991935/