From e3bb7f653e4db09449948247258d40f348c5afb2 Mon Sep 17 00:00:00 2001 From: Felipe Lalanne Date: Wed, 15 Jun 2022 16:11:23 -0400 Subject: [PATCH] Add fatrw to docker image --- Dockerfile.template | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile.template b/Dockerfile.template index c28490e2..9c9fbe9f 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -1,13 +1,17 @@ ARG ARCH=%%BALENA_ARCH%% ARG NODE_VERSION=12.16.2 +ARG FATRW_VERSION=0.1.5 FROM balenalib/$ARCH-alpine-supervisor-base:3.11 as BUILD ARG ARCH ARG NODE_VERSION +ARG FATRW_VERSION ARG NODE_ARCHIVE="node-no-intl-v${NODE_VERSION}-linux-alpine-${ARCH}.tar.gz" ARG S3_BASE="https://resin-packages.s3.amazonaws.com" ARG NODE_LOCATION="${S3_BASE}/node/v${NODE_VERSION}/${NODE_ARCHIVE}" +ARG FATRW_ARCHIVE="fatrw-${ARCH}.tar.gz" +ARG FATRW_LOCATION="https://github.com/balena-os/fatrw/releases/download/v${FATRW_VERSION}/${FATRW_ARCHIVE}" # DO NOT REMOVE THE cross-build-* COMMANDS # The following commands are absolutely needed. When we @@ -28,15 +32,14 @@ RUN apk add --no-cache \ python \ curl \ binutils \ - libgcc \ + libgcc \ libstdc++ \ libuv \ sqlite-libs \ sqlite-dev \ dmidecode \ dbus-dev \ - procmail -# procmail is installed for the lockfile binary + procmail # procmail is installed for the lockfile binary COPY build-utils/node-sums.txt . @@ -47,6 +50,15 @@ RUN curl -SLO "${NODE_LOCATION}" \ && rm -f "${NODE_ARCHIVE}" \ && strip /usr/local/bin/node +# Install fatrw +# TODO: add checksum +RUN curl -SLO "${FATRW_LOCATION}" && \ + echo curl -SLO "${FATRW_LOCATION}" && \ + ls -la "${FATRW_ARCHIVE}" && \ + tar -xzf "${FATRW_ARCHIVE}" -C /usr/local/bin && \ + rm -f "${FATRW_ARCHIVE}" && \ + strip /usr/local/bin/fatrw + COPY package*.json ./ RUN npm ci --build-from-source --sqlite=/usr/lib @@ -108,6 +120,7 @@ RUN apk add --no-cache \ WORKDIR /usr/src/app COPY --from=BUILD /usr/local/bin/node /usr/local/bin/node +COPY --from=BUILD /usr/local/bin/fatrw /usr/local/bin/fatrw COPY --from=BUILD /usr/bin/lockfile /usr/bin/lockfile COPY --from=BUILD /usr/src/app/dist ./dist COPY --from=BUILD /usr/src/app/package.json ./