pkg-fetch/Dockerfile.linuxllvm
2021-05-27 23:49:53 +01:00

44 lines
1.2 KiB
Docker

FROM ubuntu:bionic
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 g++ git make patch python python3 python3-distutils
RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list
RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-get update
RUN apt-get install -y clang lld llvm
ARG TARGET_TOOLCHAIN_ARCH
RUN [ `uname -m` = ${TARGET_TOOLCHAIN_ARCH} ] || \
apt-get install -y g++-${TARGET_TOOLCHAIN_ARCH}-linux-gnu
ENV CC="clang --target=${TARGET_TOOLCHAIN_ARCH}-unknown-linux-gnu -fuse-ld=lld"
ENV CXX="clang++ --target=${TARGET_TOOLCHAIN_ARCH}-unknown-linux-gnu -fuse-ld=lld"
ENV AR=llvm-ar
ENV NM=llvm-nm
ENV RANLIB=llvm-ranlib
ENV READELF=llvm-readelf
ENV STRIP=llvm-strip
ENV CC_host=clang
ENV CXX_host=clang++
RUN npm install -g yarn
COPY . ./
RUN yarn install
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