Commit f263ec9e authored by Raphael Defosseux's avatar Raphael Defosseux

fix(build): removed cpprest-dev as a dependency (useless)

 - also using rhel-ubi-minimal as target
 - a single dockerfile for Ubuntu18,20,22
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent 80fa71f4
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
# #
####################################### #######################################
#SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 7, RHEL 7" #SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 7, RHEL 7"
SUPPORTED_DISTRO="Ubuntu 18.04, RHEL8" SUPPORTED_DISTRO="Ubuntu 18.04,20.04,22.04, RHEL8"
if [ ! -f /etc/os-release ]; then if [ ! -f /etc/os-release ]; then
echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro." echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro."
fi fi
...@@ -129,6 +129,7 @@ check_supported_distribution() { ...@@ -129,6 +129,7 @@ check_supported_distribution() {
case "$distribution" in case "$distribution" in
"ubuntu18.04") return 0 ;; "ubuntu18.04") return 0 ;;
"ubuntu20.04") return 0 ;; "ubuntu20.04") return 0 ;;
"ubuntu22.04") return 0 ;;
"rhel8") return 0 ;; "rhel8") return 0 ;;
"rhel8.2") return 0 ;; "rhel8.2") return 0 ;;
"rhel8.3") return 0 ;; "rhel8.3") return 0 ;;
...@@ -165,7 +166,10 @@ clean_kernel() { ...@@ -165,7 +166,10 @@ clean_kernel() {
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
disable_ipv6() { disable_ipv6() {
$SUDO sysctl -w net.ipv6.conf.all.disable_ipv6=1 if [ $IS_CONTAINER -eq 0 ]
then
$SUDO sysctl -w net.ipv6.conf.all.disable_ipv6=1
fi
} }
......
...@@ -68,10 +68,16 @@ install_cpprestsdk_from_git() { ...@@ -68,10 +68,16 @@ install_cpprestsdk_from_git() {
mkdir _build && cd _build mkdir _build && cd _build
$CMAKE -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF $CMAKE -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
case "$(get_distribution_release)" in
"ubuntu22.04")
sed -i -e "s#-Werror ##" ./build.ninja
;;
esac
$SUDO ninja install $SUDO ninja install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO ldconfig -v $SUDO ldconfig -v
popd popd
rm -Rf $OPENAIRCN_DIR/build/ext/cpprestsdk/_build
fi fi
echo "cpprestsdk installation complete" echo "cpprestsdk installation complete"
return 0 return 0
...@@ -158,11 +164,12 @@ install_pistache_from_git() { ...@@ -158,11 +164,12 @@ install_pistache_from_git() {
-DPISTACHE_BUILD_DOCS=false \ -DPISTACHE_BUILD_DOCS=false \
.. ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd popd
rm -Rf $OPENAIRCN_DIR/build/ext/pistache/_build
fi fi
echo "pistache installation complete" echo "pistache installation complete"
return 0 return 0
...@@ -209,6 +216,7 @@ install_nlohmann_from_git() { ...@@ -209,6 +216,7 @@ install_nlohmann_from_git() {
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd popd
rm -Rf $OPENAIRCN_DIR/build/ext/json/_build
fi fi
echo "Nlohmann Json installation complete" echo "Nlohmann Json installation complete"
return 0 return 0
...@@ -238,7 +246,7 @@ install_nghttp2_from_git() { ...@@ -238,7 +246,7 @@ install_nghttp2_from_git() {
if [[ $OS_DISTRO == "ubuntu" ]]; then if [[ $OS_DISTRO == "ubuntu" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
g++ \ g++ \
cmake \ $CMAKE \
binutils \ binutils \
autoconf \ autoconf \
automake \ automake \
...@@ -249,7 +257,7 @@ install_nghttp2_from_git() { ...@@ -249,7 +257,7 @@ install_nghttp2_from_git() {
libcunit1-dev \ libcunit1-dev \
libssl-dev \ libssl-dev \
libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \ libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \
libjemalloc-dev libsystemd-dev cython python3-dev python-setuptools" libjemalloc-dev libsystemd-dev python3-dev python-setuptools"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
gcc-c++ \ gcc-c++ \
...@@ -294,12 +302,13 @@ install_nghttp2_from_git() { ...@@ -294,12 +302,13 @@ install_nghttp2_from_git() {
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
./configure --enable-asio-lib --enable-lib-only ./configure --enable-asio-lib --enable-lib-only
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO ldconfig $SUDO ldconfig
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
git clean -x -d -ff .
popd popd
fi fi
echo "nghttp2 installation complete" echo "nghttp2 installation complete"
...@@ -332,7 +341,9 @@ check_install_amf_deps(){ ...@@ -332,7 +341,9 @@ check_install_amf_deps(){
#$SUDO systemctl mask apt-daily.timer #$SUDO systemctl mask apt-daily.timer
#$SUDO systemctl mask apt-daily-upgrade.service #$SUDO systemctl mask apt-daily-upgrade.service
#$SUDO systemctl mask apt-daily-upgrade.timer #$SUDO systemctl mask apt-daily-upgrade.timer
$SUDO sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic if [ $IS_CONTAINER -eq 0 ]; then
$SUDO sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic
fi
fi fi
update_package_db update_package_db
...@@ -345,26 +356,16 @@ check_install_amf_deps(){ ...@@ -345,26 +356,16 @@ check_install_amf_deps(){
PACKAGE_LIST="\ PACKAGE_LIST="\
autoconf \ autoconf \
automake \ automake \
bison \
build-essential \ build-essential \
$CMAKE \ $CMAKE \
daemon \
doxygen \
flex \
gdb \
wget \
git" git"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
autoconf \ autoconf \
automake \ automake \
gcc-c++ \ gcc-c++ \
bison \
$CMAKE \ $CMAKE \
make \ make \
doxygen \
flex \
gdb \
git" git"
else else
echo_fatal "$OS_DISTRO is not a supported distribution." echo_fatal "$OS_DISTRO is not a supported distribution."
...@@ -380,8 +381,9 @@ check_install_amf_deps(){ ...@@ -380,8 +381,9 @@ check_install_amf_deps(){
# Currently Ubuntu18.04 has boost 1.65 as the latest # Currently Ubuntu18.04 has boost 1.65 as the latest
# We need at least 1.66 # We need at least 1.66
# PPA has 1.67 # PPA has 1.67
$SUDO $INSTALLER install $OPTION software-properties-common
$SUDO add-apt-repository ppa:mhier/libboost-latest --yes $SUDO add-apt-repository ppa:mhier/libboost-latest --yes
$SUDO $INSTALLER update $SUDO $INSTALLER update
if [ $IS_CONTAINER -eq 0 ]; then if [ $IS_CONTAINER -eq 0 ]; then
specific_packages="libconfig++-dev libasio-dev libboost-all-dev mysql-server" specific_packages="libconfig++-dev libasio-dev libboost-all-dev mysql-server"
else else
...@@ -389,7 +391,10 @@ check_install_amf_deps(){ ...@@ -389,7 +391,10 @@ check_install_amf_deps(){
fi fi
;; ;;
"ubuntu20.04") "ubuntu20.04")
specific_packages="libconfig++-dev libasio-dev libboost-all-dev libmysqlclient-dev" specific_packages="libconfig++-dev libasio-dev libboost-all-dev"
;;
"ubuntu22.04")
specific_packages="libconfig++-dev libasio-dev libboost-all-dev"
;; ;;
esac esac
# removed libspdlog-dev # removed libspdlog-dev
...@@ -397,43 +402,30 @@ check_install_amf_deps(){ ...@@ -397,43 +402,30 @@ check_install_amf_deps(){
$specific_packages \ $specific_packages \
mysql-client \ mysql-client \
libmysqlclient-dev \ libmysqlclient-dev \
guile-2.0-dev \
libcurl4-gnutls-dev \ libcurl4-gnutls-dev \
libevent-dev \ libevent-dev \
libgcrypt?-dev \
libgmp-dev \
libhogweed? \
libidn2-0-dev \
libidn11-dev \
libpthread-stubs0-dev \
libsctp-dev \ libsctp-dev \
libssl-dev \ libssl-dev \
libtool \ libtool \
libxml2 \ libxml2 \
libxml2-dev \ libxml2-dev \
openssl \ openssl \
python \
nettle-dev \ nettle-dev \
libcurl4 \ libcurl4 \
net-tools \ net-tools \
pkg-config \ pkg-config \
ninja-build \ ninja-build \
wget \
libasan?" libasan?"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
guile-devel \
mysql \ mysql \
mysql-devel \ mysql-devel \
mysql-libs \ mysql-libs \
libconfig-devel \ libconfig-devel \
libgcrypt-devel \ libgcrypt-devel \
gmp-devel \
libidn-devel \
lksctp-tools \ lksctp-tools \
lksctp-tools-devel \ lksctp-tools-devel \
openssl-devel \ openssl-devel \
libnghttp2 \
libtool \ libtool \
libxml2 \ libxml2 \
libxml2-devel \ libxml2-devel \
...@@ -450,23 +442,33 @@ check_install_amf_deps(){ ...@@ -450,23 +442,33 @@ check_install_amf_deps(){
fi fi
echo "Install distro libs" echo "Install distro libs"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST $SUDO $INSTALLER install $OPTION $PACKAGE_LIST
# fix issue with libboost in U18 for a bare metal deployment # fix issue with libboost in U18 for a bare metal deployment
if [[ $OS_DISTRO == "ubuntu" ]]; then if [[ $OS_DISTRO == "ubuntu" ]]; then
case "$(get_distribution_release)" in case "$(get_distribution_release)" in
"ubuntu18.04") "ubuntu18.04")
$SUDO $INSTALLER remove $OPTION libboost1.65-dev || true $SUDO $INSTALLER remove $OPTION libboost1.65-dev || true
$SUDO $INSTALLER autoremove $OPTION || true
$SUDO $INSTALLER install $OPTION libboost1.67-dev $SUDO $INSTALLER install $OPTION libboost1.67-dev
;; ;;
esac esac
fi fi
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
echo "distro libs installation complete" echo "distro libs installation complete"
install_cpprestsdk_from_git $1 $2 # Ubuntu 18 --> cpprest shall be built from source
ret=$?;[[ $ret -ne 0 ]] && return $ret # Otherwise, we can just install from repo
# For the moment, not used.
#if [[ $OS_DISTRO == "ubuntu" ]]; then
# case "$(get_distribution_release)" in
# "ubuntu18.04")
# install_cpprestsdk_from_git $1 $2
# ret=$?;[[ $ret -ne 0 ]] && return $ret
# ;;
# esac
#fi
install_spdlog_from_git $1 $2 install_spdlog_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
......
...@@ -188,7 +188,7 @@ pipeline { ...@@ -188,7 +188,7 @@ pipeline {
echo "Maybe a previous build went wrong" echo "Maybe a previous build went wrong"
} }
// In case of push to `develop` branch we build from scratch // In case of push to `develop` branch we build from scratch
myShCmd('docker build --no-cache --target oai-amf --tag oai-amf:' + amf_tag + ' --file docker/Dockerfile.amf.ubuntu18 . > archives/amf_docker_image_build.log 2>&1', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('docker build --no-cache --target oai-amf --tag oai-amf:' + amf_tag + ' --file docker/Dockerfile.amf.ubuntu . > archives/amf_docker_image_build.log 2>&1', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
} }
if ("MERGE".equals(env.gitlabActionType)) { if ("MERGE".equals(env.gitlabActionType)) {
try { try {
......
...@@ -21,13 +21,16 @@ ...@@ -21,13 +21,16 @@
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
# Dockerfile for the Open-Air-Interface AMF service # Dockerfile for the Open-Air-Interface AMF service
# Valid for Ubuntu-18.04 (bionic) # Valid for Ubuntu-18.04 (bionic),
# Ubuntu-20.04 (focal),
# Ubuntu-22.04 (jammy)
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# BUILDER IMAGE # BUILDER IMAGE
#--------------------------------------------------------------------- #---------------------------------------------------------------------
ARG BASE_IMAGE=ubuntu:bionic
FROM oai-amf-base:latest as oai-amf-builder FROM oai-amf-base:latest as oai-amf-builder
# Copying source code # Copying source code
...@@ -45,7 +48,7 @@ RUN ldconfig && \ ...@@ -45,7 +48,7 @@ RUN ldconfig && \
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# TARGET IMAGE # TARGET IMAGE
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM ubuntu:bionic as oai-amf FROM $BASE_IMAGE as oai-amf
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries # We install some debug tools for the moment in addition of mandatory libraries
...@@ -56,14 +59,21 @@ RUN apt-get update && \ ...@@ -56,14 +59,21 @@ RUN apt-get update && \
psmisc \ psmisc \
net-tools \ net-tools \
bc \ bc \
libssh-? \
openssl \ openssl \
libbrotli1 \
perl \ perl \
libasan4 \ libasan? \
libgssapi-krb5-2 \ libgssapi-krb5-2 \
libldap-2.4-2 \ libldap-2.?-? \
libconfig++9v5 \ libconfig++9v5 \
libsctp1 \ libsctp1 \
&& rm -rf /var/lib/apt/lists/* libboost-thread1.??.0 \
libboost-chrono1.??.0 \
&& rm -rf /var/lib/apt/lists/* \
/lib/x86_64-linux-gnu/libboost_system.so.1.6*.0 \
/lib/x86_64-linux-gnu/libboost_chrono.so.1.6*.0 \
/lib/x86_64-linux-gnu/libboost_thread.so.1.6*.0
# Copying executable and generated libraries # Copying executable and generated libraries
WORKDIR /openair-amf/bin WORKDIR /openair-amf/bin
...@@ -74,7 +84,7 @@ COPY --from=oai-amf-builder \ ...@@ -74,7 +84,7 @@ COPY --from=oai-amf-builder \
WORKDIR /usr/lib/x86_64-linux-gnu WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=oai-amf-builder \ COPY --from=oai-amf-builder \
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 \ /usr/lib/x86_64-linux-gnu/libmysqlclient.so.* \
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0 \ /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \ /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/lib/x86_64-linux-gnu/librtmp.so.1 \ /usr/lib/x86_64-linux-gnu/librtmp.so.1 \
...@@ -85,9 +95,9 @@ WORKDIR /usr/local/lib ...@@ -85,9 +95,9 @@ WORKDIR /usr/local/lib
COPY --from=oai-amf-builder \ COPY --from=oai-amf-builder \
/usr/local/lib/libnghttp2.so.14 \ /usr/local/lib/libnghttp2.so.14 \
/usr/local/lib/libnghttp2_asio.so.1 \ /usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib/libboost_system.so.1.67.0 \ /usr/lib/libboost_system.so.1.* \
/usr/lib/libboost_thread.so.1.67.0 \ /usr/lib/libboost_thread.so.1.* \
/usr/lib/libboost_chrono.so.1.67.0 \ /usr/lib/libboost_chrono.so.1.* \
/usr/local/lib/libpistache.so \ /usr/local/lib/libpistache.so \
./ ./
......
...@@ -469,8 +469,8 @@ class HtmlReport(): ...@@ -469,8 +469,8 @@ class HtmlReport():
pistache_build_status = False pistache_build_status = False
json_build_start = False json_build_start = False
json_build_status = False json_build_status = False
cpprest_build_start = False nghttp2_build_start = False
cpprest_build_status = False nghttp2_build_status = False
base_image = False base_image = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile: with open(cwd + '/archives/' + logFileName, 'r') as logfile:
for line in logfile: for line in logfile:
...@@ -490,12 +490,12 @@ class HtmlReport(): ...@@ -490,12 +490,12 @@ class HtmlReport():
result = re.search('distro libs installation complete', line) result = re.search('distro libs installation complete', line)
if result is not None: if result is not None:
package_install = True package_install = True
result = re.search('Starting to install cpprestsdk', line) result = re.search('Starting to install nghttp2', line)
if result is not None: if result is not None:
cpprest_build_start = True nghttp2_build_start = True
result = re.search('cpprestsdk installation complete', line) result = re.search('nghttp2 installation complete', line)
if result is not None and cpprest_build_start: if result is not None and nghttp2_build_start:
cpprest_build_status = True nghttp2_build_status = True
result = re.search('Starting to install spdlog', line) result = re.search('Starting to install spdlog', line)
if result is not None: if result is not None:
spdlog_build_start = True spdlog_build_start = True
...@@ -532,11 +532,11 @@ class HtmlReport(): ...@@ -532,11 +532,11 @@ class HtmlReport():
else: else:
cell_msg += ' ** Packages Installation: KO\n' cell_msg += ' ** Packages Installation: KO\n'
if base_image: if base_image:
cell_msg += ' ** cpprestsdk Installation: N/A\n' cell_msg += ' ** nghttp2-asio Installation: N/A\n'
elif cpprest_build_status: elif nghttp2_build_status:
cell_msg += ' ** cpprestsdk Installation: OK\n' cell_msg += ' ** nghttp2-asio Installation: OK\n'
else: else:
cell_msg += ' ** cpprestsdk Installation: KO\n' cell_msg += ' ** nghttp2-asio Installation: KO\n'
if base_image: if base_image:
cell_msg += ' ** spdlog Installation: N/A\n' cell_msg += ' ** spdlog Installation: N/A\n'
elif spdlog_build_status: elif spdlog_build_status:
......
...@@ -81,18 +81,23 @@ RUN ldconfig && \ ...@@ -81,18 +81,23 @@ RUN ldconfig && \
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# TARGET IMAGE # TARGET IMAGE
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-amf FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as oai-amf
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries # We install some debug tools for the moment in addition of mandatory libraries
RUN yum update -y && \ RUN microdnf update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \ microdnf install -y \
tzdata \ tzdata \
libasan \ libasan \
lksctp-tools \
procps-ng \ procps-ng \
psmisc \ psmisc \
net-tools \ net-tools \
libevent && \ libicu \
yum clean all -y && \ boost \
libevent \
mysql-libs \
libconfig && \
microdnf clean all -y && \
rm -rf /var/cache/yum /var/cache/dnf rm -rf /var/cache/yum /var/cache/dnf
# Copying executable and generated libraries # Copying executable and generated libraries
...@@ -103,24 +108,9 @@ COPY --from=oai-amf-builder \ ...@@ -103,24 +108,9 @@ COPY --from=oai-amf-builder \
./ ./
COPY --from=oai-amf-builder \ COPY --from=oai-amf-builder \
/usr/lib64/libconfig++.so.9 \
/usr/lib64/libboost_system.so.1.66.0 \
/usr/local/lib64/libpistache.so.0 \ /usr/local/lib64/libpistache.so.0 \
/usr/local/lib/libnghttp2_asio.so \ /usr/local/lib/libnghttp2_asio.so \
/usr/local/lib/libnghttp2_asio.so.1 \ /usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib64/mysql/libmysqlclient.so.21 \
/usr/lib64/libsctp.so.1 \
/usr/local/lib64/libcpprest.so.2.10 \
/usr/lib64/libboost_random.so.1.66.0 \
/usr/lib64/libboost_thread.so.1.66.0 \
/usr/lib64/libboost_filesystem.so.1.66.0 \
/usr/lib64/libboost_chrono.so.1.66.0 \
/usr/lib64/libboost_atomic.so.1.66.0 \
/usr/lib64/libboost_date_time.so.1.66.0 \
/usr/lib64/libboost_regex.so.1.66.0 \
/usr/lib64/libicudata.so.60 \
/usr/lib64/libicui18n.so.60 \
/usr/lib64/libicuuc.so.60 \
/usr/lib64/ /usr/lib64/
RUN ldconfig && \ RUN ldconfig && \
......
...@@ -21,14 +21,17 @@ ...@@ -21,14 +21,17 @@
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
# Dockerfile for the Open-Air-Interface AMF service # Dockerfile for the Open-Air-Interface AMF service
# Valid for Ubuntu-18.04 (bionic) # Valid for Ubuntu-18.04 (bionic),
# Ubuntu-20.04 (focal),
# Ubuntu-22.04 (jammy)
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# BUILDER IMAGE # BASE IMAGE
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM ubuntu:bionic as oai-amf-builder ARG BASE_IMAGE=ubuntu:bionic
FROM $BASE_IMAGE as oai-amf-base
ARG NEEDED_GIT_PROXY ARG NEEDED_GIT_PROXY
...@@ -38,13 +41,10 @@ RUN apt-get update && \ ...@@ -38,13 +41,10 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \ psmisc \
software-properties-common \
git \ git \
vim \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Some GIT configuration commands quite useful # Some GIT configuration commands quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600 && \ RUN git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false git config --global http.sslverify false
...@@ -54,8 +54,13 @@ COPY . /openair-amf ...@@ -54,8 +54,13 @@ COPY . /openair-amf
# Installing all the needed libraries/packages to build and run AMF # Installing all the needed libraries/packages to build and run AMF
WORKDIR /openair-amf/build/scripts WORKDIR /openair-amf/build/scripts
RUN ./build_amf --install-deps --force RUN ./build_amf --install-deps --force && \
cp -Rf /openair-amf/build/ext /openair-amf-ext-ref
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM oai-amf-base as oai-amf-builder
# Building AMF # Building AMF
WORKDIR /openair-amf/build/scripts WORKDIR /openair-amf/build/scripts
RUN ldconfig && \ RUN ldconfig && \
...@@ -66,7 +71,7 @@ RUN ldconfig && \ ...@@ -66,7 +71,7 @@ RUN ldconfig && \
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# TARGET IMAGE # TARGET IMAGE
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM ubuntu:bionic as oai-amf FROM $BASE_IMAGE as oai-amf
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries # We install some debug tools for the moment in addition of mandatory libraries
...@@ -77,14 +82,21 @@ RUN apt-get update && \ ...@@ -77,14 +82,21 @@ RUN apt-get update && \
psmisc \ psmisc \
net-tools \ net-tools \
bc \ bc \
libssh-? \
openssl \ openssl \
libbrotli1 \
perl \ perl \
libasan4 \ libasan? \
libgssapi-krb5-2 \ libgssapi-krb5-2 \
libldap-2.4-2 \ libldap-2.?-? \
libconfig++9v5 \ libconfig++9v5 \
libsctp1 \ libsctp1 \
&& rm -rf /var/lib/apt/lists/* libboost-thread1.??.0 \
libboost-chrono1.??.0 \
&& rm -rf /var/lib/apt/lists/* \
/lib/x86_64-linux-gnu/libboost_system.so.1.6*.0 \
/lib/x86_64-linux-gnu/libboost_chrono.so.1.6*.0 \
/lib/x86_64-linux-gnu/libboost_thread.so.1.6*.0
# Copying executable and generated libraries # Copying executable and generated libraries
WORKDIR /openair-amf/bin WORKDIR /openair-amf/bin
...@@ -95,7 +107,7 @@ COPY --from=oai-amf-builder \ ...@@ -95,7 +107,7 @@ COPY --from=oai-amf-builder \
WORKDIR /usr/lib/x86_64-linux-gnu WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=oai-amf-builder \ COPY --from=oai-amf-builder \
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 \ /usr/lib/x86_64-linux-gnu/libmysqlclient.so.* \
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0 \ /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \ /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/lib/x86_64-linux-gnu/librtmp.so.1 \ /usr/lib/x86_64-linux-gnu/librtmp.so.1 \
...@@ -106,9 +118,9 @@ WORKDIR /usr/local/lib ...@@ -106,9 +118,9 @@ WORKDIR /usr/local/lib
COPY --from=oai-amf-builder \ COPY --from=oai-amf-builder \
/usr/local/lib/libnghttp2.so.14 \ /usr/local/lib/libnghttp2.so.14 \
/usr/local/lib/libnghttp2_asio.so.1 \ /usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib/libboost_system.so.1.67.0 \ /usr/lib/libboost_system.so.1.* \
/usr/lib/libboost_thread.so.1.67.0 \ /usr/lib/libboost_thread.so.1.* \
/usr/lib/libboost_chrono.so.1.67.0 \ /usr/lib/libboost_chrono.so.1.* \
/usr/local/lib/libpistache.so \ /usr/local/lib/libpistache.so \
./ ./
......
...@@ -351,4 +351,4 @@ IF(STATIC_LINKING) ...@@ -351,4 +351,4 @@ IF(STATIC_LINKING)
ENDIF(STATIC_LINKING) ENDIF(STATIC_LINKING)
target_link_libraries(amf ${ASAN} target_link_libraries(amf ${ASAN}
-Wl,--start-group 3GPP_COMMON_TYPES AMF CONTEXTS AMF_SCTP AMF_SECU_5GAKA AMF_SECU_NAS AMF_UTILS AMF_SBI_SERVER config++ sctp pthread ${NETTLE_LIBRARIES} ${MySQL_LIBRARY} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} nghttp2_asio boost_system boost_thread boost_chrono ssl crypt cpprest gmp pistache curl) -Wl,--start-group 3GPP_COMMON_TYPES AMF CONTEXTS AMF_SCTP AMF_SECU_5GAKA AMF_SECU_NAS AMF_UTILS AMF_SBI_SERVER config++ sctp pthread ${NETTLE_LIBRARIES} ${MySQL_LIBRARY} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} nghttp2_asio boost_system boost_thread boost_chrono ssl crypt gmp pistache curl)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment