Files
openairinterface5g/docker/Dockerfile.phySim.rhel9
Jaroslava Fiedlerova f171778b68 Update physim Dockerfile for ctest support
Set the CMAKE_RUNTIME_OUTPUT_DIRECTORY CMake option during the OAI build
to control the location of runtime target files. This ensures that ctest
can locate necessary executables after they are copied to the target
Docker image.
2025-05-16 16:29:55 +02:00

105 lines
3.7 KiB
Docker

#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface BUILD service
# Valid for RHEL9
#
#---------------------------------------------------------------------
FROM ran-base:latest AS phy-sim-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
#only install address and undefined behavior sanitizer for this container, the others don't need it
RUN dnf install -y libasan libubsan
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --phy_simulators --ninja --sanitize --build-tool-opt -k10 --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror --cmake-opt -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/opt/oai-physim/bin
#start from scratch for target executable
FROM registry.access.redhat.com/ubi9/ubi:latest AS oai-physim
RUN dnf update -y && \
dnf install -y \
lksctp-tools \
tzdata \
libgfortran \
hostname \
sudo \
procps-ng \
net-tools \
iputils \
cmake \
bc \
iproute && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
WORKDIR /opt/oai-physim/bin
COPY --from=phy-sim-build /opt/oai-physim/bin/ /opt/oai-physim/bin/
COPY --from=phy-sim-build \
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
/lib64/liblapacke.so.3 \
/lib64/libblas.so.3 \
/lib64/libcblas.so.3 \
/lib64/liblapack.so.3 \
/usr/lib64/libasan.so.6 \
/usr/lib64/libubsan.so.1 \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
/oai-ran/cmake_targets/ran_build/build/libldpc*.so \
/usr/local/lib/
RUN ldconfig && \
echo "---- ldd on physim executables ----" && \
ldd /opt/oai-physim/bin/dlsim \
/opt/oai-physim/bin/nr_dlsim \
/opt/oai-physim/bin/nr_prachsim \
/opt/oai-physim/bin/nr_ulschsim \
/opt/oai-physim/bin/polartest \
/opt/oai-physim/bin/ulsim \
/opt/oai-physim/bin/ldpctest \
/opt/oai-physim/bin/nr_dlschsim \
/opt/oai-physim/bin/nr_pbchsim \
/opt/oai-physim/bin/nr_psbchsim \
/opt/oai-physim/bin/nr_pucchsim \
/opt/oai-physim/bin/nr_ulsim \
/opt/oai-physim/bin/smallblocktest && \
echo "---- ldd on shared libraries ----" && \
ldd /usr/local/lib/libcoding.so \
/usr/local/lib/libdfts.so \
/usr/local/lib/libldpc*.so
# Copy the relevant configuration files for phySim
WORKDIR /opt/oai-physim/
COPY --from=phy-sim-build \
/oai-ran/cmake_targets/ran_build/build/openair1/PHY/CODING/tests/CTestTestfile.cmake \
/opt/oai-physim/
#CMD ["sleep", "infinity"]