Change install step to not mask errors

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-05-15 10:45:36 +01:00
parent 0428ca31b0
commit 6bfeaf7ae7
2 changed files with 12 additions and 5 deletions

View File

@ -85,10 +85,11 @@ RUN mkdir -p rootfs-overlay && \
COPY package.json package-lock.json /usr/src/app/
# Install only the production modules that have C extensions
# First try to install with npm ci, then fallback to npm install
RUN (JOBS=MAX npm ci --production --no-optional --unsafe-perm || \
JOBS=MAX npm install --production --no-optional --unsafe-perm) \
&& npm dedupe
RUN (if [ $ARCH = "i386-nlp" ]; then \
JOBS=MAX npm install --no-optional --unsafe-perm; \
else \
JOBS=MAX npm ci --no-optional --unsafe-perm; \
fi) && npm dedupe
# Remove various uneeded filetypes in order to reduce space
# We also remove the spurious node.dtps, see https://github.com/mapbox/node-sqlite3/issues/861

View File

@ -27,6 +27,7 @@ RUN echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-start && chmod +x /usr/bin/c
FROM $ARCH-base AS node-build
FROM $ARCH-base AS node-deps
ARG ARCH
ARG VERSION=master
ARG DEFAULT_MIXPANEL_TOKEN=bananasbananas
@ -40,7 +41,12 @@ RUN apt-get update && apt-get install ca-certificates \
COPY package*.json ./
RUN JOBS=MAX npm ci --no-optional --unsafe-perm || JOBS=MAX npm install --no-optional --unsafe-perm
# i386-nlp doesn't have an npm version which supports ci
RUN if [ $ARCH = "i386-nlp" ]; then \
JOBS=MAX npm install --no-optional --unsafe-perm; \
else \
JOBS=MAX npm ci --no-optional --unsafe-perm; \
fi
COPY src src/
COPY typings typings/