FROM ubuntu:noble AS build USER root:root WORKDIR /root/pkg-fetch/ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y curl software-properties-common ca-certificates gnupg # Install Node.js 20 RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs RUN apt-get install -y binutils g++ git make patch python3 python3-setuptools ARG TARGET_TOOLCHAIN_ARCH RUN [ `uname -m` = ${TARGET_TOOLCHAIN_ARCH} ] || \ apt-get install -y binutils-${TARGET_TOOLCHAIN_ARCH}-linux-gnu g++-${TARGET_TOOLCHAIN_ARCH}-linux-gnu ENV CC=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-gcc ENV CXX=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-g++ ENV AR=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-ar ENV NM=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-nm ENV RANLIB=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-ranlib ENV READELF=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-readelf ENV STRIP=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-strip ENV CC_host=gcc ENV CXX_host=g++ ENV AR_host=ar ENV NM_host=nm ENV RANLIB_host=ranlib ENV READELF_host=readelf RUN npm install -g yarn COPY . ./ RUN yarn install --ignore-engines ARG PKG_FETCH_OPTION_a ARG PKG_FETCH_OPTION_n RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --output dist FROM scratch COPY --from=build /root/pkg-fetch/dist /