-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.centos8
124 lines (108 loc) · 3.86 KB
/
Dockerfile.centos8
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
FROM centos:8
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LANG=en_US.utf8
RUN cd /etc/yum.repos.d/ && \
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum update -y && yum install -y epel-release \
&& yum install -y \
autoconf \
curl \
curl-devel \
expat-devel \
gettext \
glibc-devel \
glibc-headers \
# FIXME: Please remove following libev libraries after third party rebuilt.
libev \
libev-devel \
m4 \
make \
ncurses-devel \
openldap-devel \
openssh-clients \
openssl-devel \
# for lcov
perl-JSON \
perl-PerlIO-gzip \
perl-Digest-MD5 \
python3-devel \
python3-pip \
readline-devel \
redhat-lsb-core \
rpm-build \
sudo \
unzip \
vim \
wget \
xz \
zlib-devel \
# client
libatomic \
&& yum --enablerepo=powertools install -y ninja-build \
&& yum clean all && rm -rf /var/cache/yum
WORKDIR /root
ENV TOOLSET_CLANG_DIR=/opt/vesoft/toolset/clang/10.0.0
ENV TOOLSET_GCC_DIR=/opt/vesoft/toolset/gcc/9.3.0
ENV PATH=/opt/vesoft/toolset/cmake/bin:${TOOLSET_GCC_DIR}/bin:${TOOLSET_CLANG_DIR}/bin:${PATH}
ENV CCACHE_CPP2=1
ENV CC=${TOOLSET_GCC_DIR}/bin/gcc
ENV CXX=${TOOLSET_GCC_DIR}/bin/g++
ENV GCOV=${TOOLSET_GCC_DIR}/bin/gcov
SHELL ["/bin/bash", "-c"]
# Install gcc and llvm by nebula-gears
RUN bash <(curl -s https://raw.githubusercontent.com/vesoft-inc/nebula-gears/master/install) --prefix=/opt/vesoft/ \
&& /opt/vesoft/bin/install-gcc --version=9.3.0 \
&& /opt/vesoft/bin/install-llvm --version=10.0.0
# Install cmake
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-$(uname -m).sh \
&& chmod +x cmake-3.20.0-linux-$(uname -m).sh \
&& ./cmake-3.20.0-linux-$(uname -m).sh --skip-license --prefix=/usr/local \
&& rm cmake-3.20.0-linux-$(uname -m).sh
# Install git 2.25
RUN wget -qO- https://github.com/git/git/archive/v2.25.0.tar.gz | tar zxf - -C ./ \
&& cd git-2.25.0 \
&& make configure \
&& ./configure --prefix=/usr \
&& make -j$(nproc) && make install \
&& cd ../ && rm -rf git-2.25.0
# Install nebula third-party 1.0 and 2.0 and 3.0 and 3.3
RUN git clone https://github.com/vesoft-inc/nebula-third-party.git \
&& cd nebula-third-party \
&& ./install-third-party.sh \
&& git checkout origin/release-3.3 \
&& ./install-third-party.sh \
&& git checkout origin/v3.0 \
&& ./install-third-party.sh \
&& git checkout origin/v2.0 \
&& ./install-third-party.sh \
&& git checkout origin/v1.0 \
&& ./install-third-party.sh \
&& cd .. && rm -rf nebula-third-party
# Install ccache
RUN wget -qO- https://github.com/ccache/ccache/releases/download/v3.7.7/ccache-3.7.7.tar.gz | tar zxf - -C ./ \
&& cd ccache-3.7.7 \
&& ./configure \
&& make -j \
&& make install \
&& cd ../ && rm -rf ccache-*
# Install lcov to /usr/local/bin, require master to make gcc9 happy
RUN git clone --branch master --single-branch https://github.com/linux-test-project/lcov.git \
&& cd lcov && git checkout 75fbae1cfc5027f818a0bb865bf6f96fab3202da \
&& make install && cd ../ && rm -rf lcov
# fastcov
RUN pip3 install --no-cache-dir fastcov
# Install ossutil
RUN curl https://gosspublic.alicdn.com/ossutil/install.sh | bash
#Install mold
RUN mkdir /usr/local/mold && wget -qO- https://github.com/rui314/mold/releases/download/v2.1.0/mold-2.1.0-$(uname -m)-linux.tar.gz | tar xzf - --strip-components=1 -C /usr/local/mold/
ENV PATH=/usr/local/mold/bin:${PATH}
#Install minio client
RUN if [ "$(uname -m)" = "x86_64" ]; then \
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc; \
else \
curl -O https://dl.min.io/client/mc/release/linux-arm64/mc; \
fi \
&& chmod +x mc \
&& mv mc /usr/local/bin/