-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile-devel-ubuntu22.04
168 lines (150 loc) · 5.04 KB
/
Dockerfile-devel-ubuntu22.04
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
FROM ubuntu:22.04
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"
# Timezone problem
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Upgrade softwares
RUN apt update -y && \
apt upgrade -y && \
apt clean -y
# GCC (force 10) and LLVM (force to 15)
RUN apt install -y \
gcc-10 \
g++-10 \
llvm-15-dev \
clang-15 \
make \
gdb \
pkg-config \
locales && \
update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave \
/usr/bin/g++ g++ /usr/bin/g++-10 && \
update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-15 60 --slave \
/usr/bin/clang++ clang++ /usr/bin/clang++-15 --slave \
/usr/bin/clang clang /usr/bin/clang-15 && \
apt clean -y
# Generate locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
sed -i '/zh_CN/s/^# //g' /etc/locale.gen && \
locale-gen
# Dependencies
RUN DEBIAN_FRONTEND=noninteractive \
apt install -y \
bison \
flex \
gettext \
krb5-admin-server \
krb5-kdc \
krb5-user \
libaio-dev \
libdbi-perl \
libexpect-perl \
libfile-find-rule-perl \
libfuse-dev \
libgss-dev \
libicu-dev \
libipc-run-perl \
libkrb5-dev \
libldap2-dev \
liblz4-dev \
libpam0g-dev \
libperl-dev \
libreadline-dev \
libssl-dev \
libunwind-dev \
libxerces-c-dev \
libxml2-dev \
libxslt1-dev \
python3-dev \
tcl-dev \
uuid-dev \
&& \
apt clean -y
# Tools
RUN apt install -y \
autoconf \
iproute2 \
wget \
ccache \
sudo \
vim \
git \
cmake && \
apt clean -y
# PostGIS
RUN apt install -y \
libgeos-dev \
libproj-dev \
libgdal-dev \
libprotobuf-c-dev \
protobuf-compiler \
protobuf-c-compiler && \
apt clean -y
# install perl module for TAP test
RUN 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*
# add software repository of Node.js LTS
# @see https://github.com/nodesource/distributions
# use yarn for documentation development
# RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
# apt install -y nodejs && \
# apt clean -y && \
# corepack enable && corepack prepare yarn@stable --activate
# create default user
ENV USER_NAME=postgres
RUN echo "create default user" && \
groupadd -r $USER_NAME && \
useradd -u 1000 -ms /bin/bash -g $USER_NAME $USER_NAME -p '' && \
usermod -aG sudo $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 && \
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 && \
echo 'done'
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