-
Notifications
You must be signed in to change notification settings - Fork 74
/
bc-dev-rocky9
115 lines (101 loc) · 3.13 KB
/
bc-dev-rocky9
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
###############################################################################
# Dockerfile used to make gitlab.linphone.org:4567/bc/public/flexisip/bc-dev-rocky9:20240912_cpp-jwt_no_protobuf
###############################################################################
FROM rockylinux:9
MAINTAINER Thibault Lemaire <[email protected]>
# Install common general tools
RUN dnf install -y sudo vim wget
# 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 \
gcc-c++ \
gdb \
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
openssl-devel \
boost-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 \
redis \
# Dependencies of the B2BUA
libvpx-devel \
jsoncpp-devel \
# Dependencies of the tester
mariadb-server \
&& dnf -y clean all
# Install CMake 3.22.6
COPY cmake_install.sh .
RUN ./cmake_install.sh 3.22.6 \
&& rm cmake_install.sh \
&& dnf -y remove cmake
# Install libnghttp2_asio 1.39.2
COPY libnghttp2_asio_install.sh .
RUN ./libnghttp2_asio_install.sh 1.39.2
# 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
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" -DENABLE_UNIT_TESTS=ON -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
# cd $BUILD_DIR_NAME
# cmake --build . --target install