FROM ubuntu:bionic ARG TARGET_TOOLCHAIN_ARCH ARG PKG_FETCH_OPTION_a ARG PKG_FETCH_OPTION_n USER root:root WORKDIR /root/pkg-fetch/ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y curl software-properties-common RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - RUN apt-get install -y nodejs RUN apt-get install -y binutils gcc-8 g++-8 git make patch python python3 python3-distutils RUN apt-get install -y binutils-$TARGET_TOOLCHAIN_ARCH-linux-gnu gcc-8-$TARGET_TOOLCHAIN_ARCH-linux-gnu g++-8-$TARGET_TOOLCHAIN_ARCH-linux-gnu ENV CC=/usr/bin/$TARGET_TOOLCHAIN_ARCH-linux-gnu-gcc-8 ENV CXX=/usr/bin/$TARGET_TOOLCHAIN_ARCH-linux-gnu-g++-8 ENV AR=/usr/bin/$TARGET_TOOLCHAIN_ARCH-linux-gnu-ar ENV NM=/usr/bin/$TARGET_TOOLCHAIN_ARCH-linux-gnu-nm ENV READELF=/usr/bin/$TARGET_TOOLCHAIN_ARCH-linux-gnu-readelf ENV STRIP=/usr/bin/$TARGET_TOOLCHAIN_ARCH-linux-gnu-strip ENV CC_host=/usr/bin/gcc-8 ENV CXX_host=/usr/bin/g++-8 ENV AR_host=/usr/bin/ar ENV NM_host=/usr/bin/nm ENV READELF_host=/usr/bin/readelf RUN npm install -g yarn COPY . ./ RUN yarn install RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --output dist