Upgrade debug builds to node 10 for supported architectures

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-05-09 12:15:47 +01:00
parent 4e779608a3
commit 2e6f030063
2 changed files with 25 additions and 19 deletions

View File

@ -70,13 +70,13 @@ WORKDIR /usr/src/app
RUN apt-get update \
&& apt-get install -y \
g++ \
git \
libsqlite3-dev \
make \
python \
rsync \
wget \
g++ \
git \
libsqlite3-dev \
make \
python \
rsync \
wget \
&& rm -rf /var/lib/apt/lists/
RUN mkdir -p rootfs-overlay && \
@ -87,18 +87,18 @@ 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) \
JOBS=MAX npm install --production --no-optional --unsafe-perm) \
&& 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
RUN find . -path '*/coverage/*' -o -path '*/test/*' -o -path '*/.nyc_output/*' \
-o -name '*.tar.*' -o -name '*.in' -o -name '*.cc' \
-o -name '*.c' -o -name '*.coffee' -o -name '*.eslintrc' \
-o -name '*.h' -o -name '*.html' -o -name '*.markdown' \
-o -name '*.md' -o -name '*.patch' -o -name '*.png' \
-o -name '*.yml' -o -name "*.ts" \
-delete \
-o -name '*.tar.*' -o -name '*.in' -o -name '*.cc' \
-o -name '*.c' -o -name '*.coffee' -o -name '*.eslintrc' \
-o -name '*.h' -o -name '*.html' -o -name '*.markdown' \
-o -name '*.md' -o -name '*.patch' -o -name '*.png' \
-o -name '*.yml' -o -name "*.ts" \
-delete \
&& find . -type f -path '*/node_modules/sqlite3/deps*' -delete \
&& find . -type f -path '*/node_modules/knex/build*' -delete \
&& rm -rf node_modules/sqlite3/node.dtps

View File

@ -2,21 +2,27 @@ ARG ARCH=amd64
# The node version here should match the version of the runtime image which is
# specified in the base-image subdirectory in the project
FROM balenalib/raspberry-pi-node:8-run as rpi-base
FROM balenalib/armv7hf-node:8-run as armv7hf-base
FROM balenalib/aarch64-node:8-run as aarch64-base
FROM balenalib/raspberry-pi-node:10-run as rpi-base
FROM balenalib/armv7hf-node:10-run as armv7hf-base
FROM balenalib/aarch64-node:10-run as aarch64-base
RUN [ "cross-build-start" ]
RUN sed -i '/security.debian.org jessie/d' /etc/apt/sources.list
RUN [ "cross-build-end" ]
FROM balenalib/amd64-node:8-run as amd64-base
FROM balenalib/amd64-node:10-run as amd64-base
RUN echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-start && chmod +x /usr/bin/cross-build-start \
&& echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-end && chmod +x /usr/bin/cross-build-end
FROM balenalib/i386-node:8-run as i386-base
FROM balenalib/i386-debian as i386-base
RUN echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-start && chmod +x /usr/bin/cross-build-start \
&& echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-end && chmod +x /usr/bin/cross-build-end
# node has stopped releasing node for i386 binaries. We
# build it ourselves here
RUN apt-get update && apt-get install build-essential python make git
RUN git clone https://github.com/nodejs/node && cd node && git checkout v10.15.0 && \
./configure && make -j 4 && make install
FROM resin/i386-node:6.13.1-slim as i386-nlp-base
RUN echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-start && chmod +x /usr/bin/cross-build-start \
&& echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-end && chmod +x /usr/bin/cross-build-end \