I am building a Resin app which has an npm install in the Dockerfile. The build succeeds and deploys to my RaspberryPi, however the npm install did not correctly install and build dependancies and so my node app crashes. If I ssh into the container, delete the node_modules folder and run an npm install again the dependancies will install and build correctly for the Pi.
My questions is, what is the difference between the Resin Docker build server and the RaspberryPi to cause npm install to build differently?
The package which is not building correctly is
leveldown which builds binaries as part on the install.
My Dockerfile with successful, but not working, npm install
FROM orbitbox/orbit-os-node:latest # Install Backend RUN mkdir -p /srv/api COPY app/package.json /srv/api RUN cd /srv/api && JOBS=MAX npm install --unsafe-perm && npm cache clean COPY app /srv/api # Install Frontend COPY build /srv/static CMD mkdir -p /data/db \ && /init \ && NODE_ENV=production BACKEND_PORT=$BACKEND_PORT DB_PATH=/data/db/ forever /srv/api
Commands I run in container for working npm install
cd /srv/api rm -r node_modules npm install
Thanks for any advice.