-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.centos7
83 lines (67 loc) · 2.09 KB
/
Dockerfile.centos7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM centos:centos7 as build
RUN yum repolist && yum update -y \
&& \
yum install -y \
git \
krb5-devel \
libcurl-devel \
libgdiplus \
libicu-devel \
lttng-ust-devel \
openssl-devel \
sudo \
wget \
which \
zlib-devel \
gcc-multilib \
ninja-build \
python3 \
centos-release-scl \
scl-utils \
&& \
yum clean all
RUN yum update -y \
&& \
yum install -y \
devtoolset-11 \
&& \
yum clean all
RUN wget -O v1.11.1.tar.gz https://github.com/ninja-build/ninja/archive/refs/tags/v1.11.1.tar.gz && \
mkdir ninja && \
tar -xvf v1.11.1.tar.gz -C ninja
RUN cd ninja/ninja-1.11.1 && \
source scl_source enable devtoolset-11 && \
ls -l && \
./configure.py --bootstrap && \
./ninja -v && \
mv ./ninja /usr/bin
RUN rm -rf ninja
RUN mkdir /workdir
WORKDIR /workdir
# Install CMake 3.26.5
RUN wget -O cmake-install.sh https://github.com/Kitware/CMake/releases/download/v3.26.5/cmake-3.26.5-Linux-x86_64.sh && \
bash ./cmake-install.sh --skip-license --exclude-subdir --prefix=/usr/local && \
rm -f ./cmake-install.sh
RUN wget -O llvmorg-16.0.6.tar.gz https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-16.0.6.tar.gz && \
mkdir llvm && \
tar -xvf llvmorg-16.0.6.tar.gz -C llvm
RUN cd llvm/llvm-project-llvmorg-16.0.6 && \
source scl_source enable devtoolset-11 && \
cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_BUILD_TYPE=Release
RUN cd llvm/llvm-project-llvmorg-16.0.6 && \
source scl_source enable devtoolset-11 && \
ninja -C build clang
RUN cd llvm/llvm-project-llvmorg-16.0.6 && \
source scl_source enable devtoolset-11 && \
ninja -C build lld
RUN cd llvm/llvm-project-llvmorg-16.0.6 && \
source scl_source enable devtoolset-11 && \
ninja -C build install
RUN rm -rf /workdir/*
RUN rsync -ravh --exclude '/sys' /opt/rh/devtoolset-11/root/ /
RUN yum remove devtoolset-11 -y \
&& \
yum clean all
FROM build as final
FROM scratch
COPY --from=build / /