Repository navigation
Expand file tree
/
Copy pathbc-dev-rocky9
More file actions
126 lines (110 loc) · 3.86 KB
/
Copy pathbc-dev-rocky9
File metadata and controls
126 lines (110 loc) · 3.86 KB
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
###############################################################################
# Dockerfile used to make gitlab.linphone.org:4567/bc/public/flexisip/bc-dev-rocky9:20260619_remove_nghttp2_asio
###############################################################################
FROM rockylinux:9
LABEL org.opencontainers.image.authors="Belledonne Communications <flexisip@belledonne-communications.com>"
# Install common general tools
RUN dnf install -y sudo vim wget curl-minimal tar
# Configure additional repositories
RUN dnf install -y \
epel-release \
dnf-plugins-core \
# Code Ready Builder
&& dnf config-manager -y --set-enabled crb
# Update
RUN dnf makecache --refresh \
&& dnf -y update \
# Install development tools
&& dnf -y install \
bzip2 \
ccache \
clang \
cmake \
c-ares-devel \
doxygen \
gcc-toolset-15 \
gcc-toolset-15-libasan-devel \
gcc-toolset-15-libubsan-devel \
git \
libasan \
libev-devel \
libubsan \
libuv-devel \
llvm \
make \
ninja-build \
python3 \
python3-pip \
rpm-build \
yasm \
zlib-devel \
# Install all dependencies needed for Flexisip
systemd-devel \
openssl-devel \
cpp-jwt-devel \
# json-devel is a depency of cpp-jwt but not declared in its package dependencies
json-devel \
hiredis-devel \
jansson-devel \
libsqlite3x-devel \
libpq-devel \
mariadb-devel \
nghttp2 \
libnghttp2-devel \
net-snmp-devel \
xerces-c-devel \
gsm-devel \
opus-devel \
mbedtls-devel \
speex-devel \
speexdsp-devel \
libxml2-devel \
# Dependencies of the B2BUA
libvpx-devel \
jsoncpp-devel \
# Dependencies of the tester
mysql-server \
rsync \
squid \
&& dnf -y module install redis \
&& dnf -y clean all
# Install boost 1.81 (version available from repo is only 1.75, which is not compatible with GCC 15).
RUN wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download \
&& tar xzf boost_1_81_0.tar.gz \
&& cd boost_1_81_0 \
&& ./bootstrap.sh --prefix=/usr/local \
&& ./b2 --with=all -j 8 install \
&& cd .. \
&& rm -rf boost_1_81_0 boost_1_81_0.tar.gz \
&& export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Set rights to mysqld binary. For some unkown reason, mysqld is not executable even by root.
# Resetting the ownership solves the problem.
RUN chown root:root /usr/sbin/mysqld
# Configure user bc
RUN useradd -ms /bin/bash bc && \
echo 'bc:cotcot' | chpasswd && \
echo 'bc ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Switch to 'bc' user
USER bc
WORKDIR /home/bc
# Install python3 modules.
# This must be done as user 'bc' because python modules are installed in /usr/local/lib when pip is invoked
# as root, and rpmbuild prevents python from searching its modules in this prefix. Installing with user 'bc' puts
# the modules in /home/bc/.local/bin.
RUN python3 -m pip install --user pystache six
ENV PATH=$PATH:/home/bc/.local/bin
# Load gcc-toolset-15 environment on starting
RUN echo 'source /opt/rh/gcc-toolset-15/enable' >> /home/bc/.bashrc && \
echo 'source /opt/rh/gcc-toolset-15/enable' >> /home/bc/.shrc
ENV PS1='\[\e[34m\]\u@bc-dev-rocky9>\[\e[0m\] '
# CVE-2022-24765, from git 2.35.2 onward
RUN git config --global --add safe.directory *
# Example build commands
#
# export CC=gcc
# export CXX=g++
# export BUILD_DIR_NAME="build.rocky9"
# cd flexisip/
# cmake -S . -B ./$BUILD_DIR_NAME -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$PWD/$BUILD_DIR_NAME/install" -DINTERNAL_LIBHIREDIS=ON -DENABLE_UNIT_TESTS=ON -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
# cd $BUILD_DIR_NAME
# cmake --build . --target install