Reputation: 75
Recently my Heroku Review Apps using Docker stoped building. They were previously behaving as expected, but it now appears that npm cannot find git on the PATH.
My first guess was that for some reason I now need install git into the carbon-alpine. See my attempt below with where I added 'RUN npm install --no-cache git'
Any help would be appreciated! I also really like to know why it was behaving as expected.
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://[email protected]/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
Upvotes: 1
Views: 462
Reputation: 1326832
Using a custom nodejs/docker-node image is:
Upvotes: 1