gmod-lcpu/Containerfile.llvm

32 lines
993 B
Plaintext
Raw Normal View History

# global arguments
ARG LLVM_SOURCE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz"
ARG LLVM_VERSION="16"
# the base layer.
FROM debian:oldstable AS base
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update
# base layer for building anything
FROM base AS build-base
WORKDIR /build
ARG BUILD_DEPS="curl ca-certificates build-essential python3 cmake ninja-build pkg-config git zlib1g-dev"
RUN apt-get install -y --no-install-recommends $BUILD_DEPS
# This layer extracts the LLVM source code extracted to /build/llvm
FROM build-base as llvm-base
ARG LLVM_SOURCE_URL
RUN mkdir llvm && \
cd llvm && \
curl -L $LLVM_SOURCE_URL | tar --strip-components=1 -xJf -
# This will launch the builder script.
# /build/llvm-bin is expected to be mounted to a host directory.
FROM llvm-base as llvm-build
COPY scripts/build_llvm.sh .
ARG LLVM_VERSION
ENV LLVM_VERSION=$LLVM_VERSION
ENTRYPOINT [ "/bin/bash" ]
CMD [ "/build/build_llvm.sh" ]