pkg-fetch/Dockerfile.linuxcross
Jesse Chan 6de6de36a3 CI: use Docker to build binaries for linux-arm64
Recently it comes to my attention that Github Actions image installs
experimental C++ standard library from an unsupported PPA, which
effectively breaks assumptions of binary compatibility for the OS
(in this case, Ubuntu 18.04+).

Unfortunately, as a result, the Github Actions environment can no
longer be trusted to compile proper binaries.

This change adds a Dockerfile that composes a proper Ubuntu 18.04
environment from official "ubuntu:bionic" image, and builds Node
binaries in it.

Bug: actions/virtual-environments#3432
2021-05-27 10:49:48 +01:00

39 lines
1.2 KiB
Docker

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