68 lines
3.4 KiB
Docker
68 lines
3.4 KiB
Docker
FROM ran-base:latest AS ran-build
|
|
ARG BUILD_OPTION
|
|
|
|
RUN rm -Rf /oai-ran
|
|
WORKDIR /oai-ran
|
|
COPY . .
|
|
|
|
# build all targets so final targets can be created afterwards
|
|
RUN /bin/sh oaienv && \
|
|
cd cmake_targets && \
|
|
./build_oai --ninja \
|
|
--gNB --RU --nrUE -w SIMU -w USRP --build-lib telnetsrv \
|
|
--build-e2 --cmake-opt -DKPM_VERSION=KPM_V3_00 --cmake-opt -DE2AP_VERSION=E2AP_V3 \
|
|
--cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \
|
|
echo "---- ldd on executables ----" && \
|
|
ldd ran_build/build/*softmodem* ran_build/build/nr-cuup ran_build/build/oairu && \
|
|
echo "---- ldd on shared libraries ----" && \
|
|
ldd ran_build/build/*.so
|
|
|
|
RUN set -eux; \
|
|
apt-get update; \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
ca-certificates curl wget iproute2 iputils-ping dnsutils jq \
|
|
iperf iperf3 ffmpeg gdb\
|
|
nghttp2-client || true; \
|
|
if ! command -v h2load >/dev/null 2>&1; then \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nghttp2 || true; \
|
|
fi; \
|
|
wget -O /usr/local/bin/sipp https://github.com/SIPp/sipp/releases/download/v3.7.7/sipp && chmod +x /usr/local/bin/sipp; \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# FlexRIC libraries (built by --build-e2) - only copy service model libraries (*_sm.so).
|
|
# The source tree can carry a pre-existing FlexRIC build directory whose object-file
|
|
# timestamps are newer than freshly copied headers. Force the MAC service model and
|
|
# xApp to rebuild so mac_ind_msg_t has one ABI in the gNB, plugin, and xApp. Install
|
|
# plugins only after that rebuild.
|
|
RUN mkdir -p /usr/local/etc/flexric /usr/local/lib/flexric && \
|
|
cp /oai-ran/openair2/E2AP/flexric/flexric.conf /usr/local/etc/flexric/ 2>/dev/null || true && \
|
|
cd /oai-ran/openair2/E2AP/flexric/build && \
|
|
sed -i 's|/home/[^/]*/openairinterface5g|/oai-ran|g' CMakeCache.txt && \
|
|
find . -name 'Makefile' -o -name '*.cmake' | xargs sed -i 's|/home/[^/]*/openairinterface5g|/oai-ran|g' 2>/dev/null || true && \
|
|
find src/sm/mac_sm/CMakeFiles/mac_sm.dir src/sm/mac_sm/CMakeFiles/mac_sm_static.dir \
|
|
-type f \( -name '*.o' -o -name '*.o.d' \) -delete && \
|
|
rm -f src/sm/mac_sm/libmac_sm.so src/sm/mac_sm/libmac_sm_static.a \
|
|
examples/xApp/c/monitor/CMakeFiles/xapp_nakaolab.dir/xapp_nakaolab.c.o \
|
|
examples/xApp/c/monitor/CMakeFiles/xapp_nakaolab.dir/xapp_nakaolab.c.o.d && \
|
|
cmake --build . --target mac_sm mac_sm_static xapp_nakaolab -j2 && \
|
|
find /oai-ran/openair2/E2AP/flexric/build -name "*_sm.so" -exec cp {} /usr/local/lib/flexric/ \; && \
|
|
echo "/usr/local/lib/flexric" > /etc/ld.so.conf.d/flexric.conf && ldconfig && \
|
|
ls -la /usr/local/lib/flexric/
|
|
|
|
# Install netcat for antenna control testing + paramiko for M-Plane NETCONF server
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
netcat-openbsd python3-pip \
|
|
&& pip3 install --break-system-packages paramiko \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# O-RU M-Plane NETCONF server (o-ran-uplane-conf antenna mask control)
|
|
# Listens on port 831, translates NETCONF edit-config to internal antenna control
|
|
COPY mplane/mplane_server.py /opt/mplane/mplane_server.py
|
|
COPY mplane/wg4-capability.json /opt/mplane/wg4-capability.json
|
|
COPY mplane/gnb-mplane-entrypoint.sh /opt/mplane/gnb-mplane-entrypoint.sh
|
|
RUN chmod +x /opt/mplane/gnb-mplane-entrypoint.sh
|
|
|
|
EXPOSE 831
|
|
|
|
ENTRYPOINT ["/bin/bash"]
|