Update fatrw to v0.2.21

Update fatrw from 0.2.9 to 0.2.21

Change-type: patch
This commit is contained in:
Felipe Lalanne 2024-03-08 11:42:53 -03:00
parent 17edef2836
commit 772702793c
2 changed files with 31 additions and 4 deletions

View File

@ -1,5 +1,5 @@
ARG ARCH=%%BALENA_ARCH%%
ARG FATRW_VERSION=0.2.9
ARG FATRW_VERSION=0.2.21
ARG NODE="nodejs~=20"
ARG NPM="npm~=10"
ARG ALPINE_VERSION="3.19"
@ -13,8 +13,7 @@ ARG ARCH
ARG NODE
ARG NPM
ARG FATRW_VERSION
ARG FATRW_ARCHIVE="fatrw-${ARCH}.tar.gz"
ARG FATRW_LOCATION="https://github.com/balena-os/fatrw/releases/download/v${FATRW_VERSION}/${FATRW_ARCHIVE}"
ARG FATRW_RELEASES="https://github.com/balena-os/fatrw/releases/download/v${FATRW_VERSION}"
WORKDIR /usr/src/app
@ -30,11 +29,14 @@ RUN apk add --update --no-cache \
rust
COPY package*.json ./
COPY ./build-utils/rust-arch.sh /
RUN strip "$(which node)"
# Install fatrw
RUN curl -SLO "${FATRW_LOCATION}" && \
RUN FATRW_ARCHIVE="fatrw-$(/rust-arch.sh).tar.gz" && \
FATRW_LOCATION="${FATRW_RELEASES}/${FATRW_ARCHIVE}" && \
curl -SLO "${FATRW_LOCATION}" && \
ls -la "${FATRW_ARCHIVE}" && \
tar -xzf "${FATRW_ARCHIVE}" -C /usr/local/bin && \
rm -f "${FATRW_ARCHIVE}"

25
build-utils/rust-arch.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# rust-arch.sh
# return the rust triple corresponding to the apk arch
apk_arch=$(apk --print-arch)
case $apk_arch in
x86_64)
printf "x86_64-unknown-linux-musl"
;;
aarch64)
printf "aarch64-unknown-linux-musl"
;;
armv7)
printf "armv7-unknown-linux-musleabihf"
;;
armhf)
printf "arm-unknown-linux-musleabihf"
;;
x86)
printf "i686-unknown-linux-musl"
;;
*)
printf "%s" "$apk_arch"
;;
esac