-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile-devel-anolis8
147 lines (131 loc) · 4.29 KB
/
Dockerfile-devel-anolis8
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
FROM openanolis/anolisos:8.6
ARG TARGETARCH
LABEL maintainer="mrdrivingduck@gmail.com"
COPY misc/pg_bsd_indent_$TARGETARCH /usr/bin/pg_bsd_indent
CMD bash
ENV PATH="/home/postgres/tmp_polardb_pg_17_base/bin:/home/postgres/tmp_polardb_pg_16_base/bin:/home/postgres/tmp_polardb_pg_15_base/bin:/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin:$PATH"
# install EPEL
RUN dnf upgrade -y --refresh && \
dnf install -y \
epel-release epel-next-release && \
dnf remove -y langpacks-en && \
dnf install -y \
glibc-langpack-en \
glibc-langpack-zh \
&& \
dnf clean all
# GCC and LLVM (should be 15)
RUN dnf install -y \
gcc \
gcc-c++ \
gdb \
make \
cmake \
clang \
llvm-devel \
&& \
dnf clean all
# Dependencies
RUN dnf install -y \
bison \
flex \
fuse-devel \
gettext \
krb5-devel \
krb5-server \
krb5-workstation \
libaio-devel \
libicu-devel \
libunwind-devel \
libuuid-devel \
libxml2-devel \
libxslt-devel \
libzstd-devel \
lz4-devel \
openldap-devel \
openssl-devel \
pam-devel \
perl-CPAN \
perl-DBI \
perl-IPC-Run \
perl-ExtUtils-Embed \
perl-File-Find-Rule \
perl-Test-Simple \
python3-devel \
readline-devel \
tcl-devel \
xerces-c-devel \
zlib-devel \
&& \
dnf clean all
# Tools
RUN dnf install -y \
autoconf \
wget \
sudo \
vim \
git \
rpm-build \
&& \
dnf clean all
# install perl module for TAP test
RUN perl -MCPAN -e "CPAN::Shell->notest('install', 'Expect')" && \
perl -MCPAN -e "CPAN::Shell->notest('install', 'SHANCOCK/Perl-Tidy-20230309.tar.gz')"
# set to empty if GitHub is not barriered
# ENV GITHUB_PROXY=https://ghproxy.com/
ENV GITHUB_PROXY=
ENV ZLOG_VERSION=1.2.14
ENV PFSD_VERSION=pfsd4pg-release-1.2.42-20220419
# install dependencies from GitHub mirror
RUN cd /usr/local && \
# zlog for PFSD
wget --no-verbose --no-check-certificate "${GITHUB_PROXY}https://github.com/HardySimpson/zlog/archive/refs/tags/${ZLOG_VERSION}.tar.gz" && \
# PFSD
wget --no-verbose --no-check-certificate "${GITHUB_PROXY}https://github.com/ApsaraDB/PolarDB-FileSystem/archive/refs/tags/${PFSD_VERSION}.tar.gz" && \
# unzip and install zlog
gzip -d $ZLOG_VERSION.tar.gz && \
tar xpf $ZLOG_VERSION.tar && \
cd zlog-$ZLOG_VERSION && \
make && make install && \
echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig && \
cd .. && \
rm -rf $ZLOG_VERSION* && \
rm -rf zlog-$ZLOG_VERSION && \
# unzip and install PFSD
gzip -d $PFSD_VERSION.tar.gz && \
tar xpf $PFSD_VERSION.tar && \
cd PolarDB-FileSystem-$PFSD_VERSION && \
sed -i 's/-march=native //' CMakeLists.txt && \
./autobuild.sh && ./install.sh && \
cd .. && \
rm -rf $PFSD_VERSION* && \
rm -rf PolarDB-FileSystem-$PFSD_VERSION* && \
ldconfig
# create default user
ENV USER_NAME=postgres
RUN echo "create default user" && \
groupadd -r $USER_NAME -g 1000 && \
useradd -u 1000 -g $USER_NAME $USER_NAME -p '' && \
usermod -aG wheel $USER_NAME
WORKDIR /home/$USER_NAME
# modify conf
RUN echo "modify conf" && \
mkdir -p /var/log/pfs && chown $USER_NAME /var/log/pfs && \
mkdir -p /var/run/pfs && chown $USER_NAME /var/run/pfs && \
mkdir -p /var/run/pfsd && chown $USER_NAME /var/run/pfsd && \
mkdir -p /dev/shm/pfsd && chown $USER_NAME /dev/shm/pfsd && \
touch /var/run/pfsd/.pfsd && \
chkconfig --add pfsd_env && \
echo "ulimit -c unlimited" >> /home/postgres/.bashrc && \
echo "export PGHOST=127.0.0.1" >> /home/postgres/.bashrc && \
echo "export PATH=/home/postgres/tmp_polardb_pg_15_base/bin:\$PATH" >> /home/postgres/.bashrc && \
echo "export PATH=/home/postgres/tmp_polardb_pg_16_base/bin:\$PATH" >> /home/postgres/.bashrc && \
echo "export PATH=/home/postgres/tmp_polardb_pg_17_base/bin:\$PATH" >> /home/postgres/.bashrc && \
rm /etc/localtime && \
cp /usr/share/zoneinfo/UTC /etc/localtime && \
sed -i 's/vim/vi/g' /root/.bashrc
WORKDIR /home/$USER_NAME
USER $USER_NAME
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8