56 lines
2.2 KiB
Docker
56 lines
2.2 KiB
Docker
FROM ran-base-temp: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 && \
|
|
mkdir -p log && \
|
|
./build_oai -c --ninja \
|
|
--gNB --RU --nrUE -w SIMU\
|
|
--build-lib "telnetsrv enbscope uescope nrscope" \
|
|
-w USRP -t Ethernet \
|
|
--build-e2 --cmake-opt -DKPM_VERSION=KPM_V2_03 --cmake-opt -DE2AP_VERSION=E2AP_V2 \
|
|
--noavx512 \
|
|
--build-tool-opt -k10 \
|
|
--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; \
|
|
# Try to install sipp from apt; if unavailable, build from source
|
|
if apt-cache show sipp >/dev/null 2>&1; then \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sipp; \
|
|
else \
|
|
echo "sipp not in apt, building from source..."; \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
build-essential cmake git libncurses5-dev libpcap-dev libssl-dev libpcre3-dev; \
|
|
git clone --depth=1 https://github.com/SIPp/sipp.git /tmp/sipp; \
|
|
cd /tmp/sipp; cmake -DENABLE_SSL=1 -DENABLE_PCAP=1 -DCMAKE_BUILD_TYPE=Release .; \
|
|
make -j"$(nproc)"; make install; strip /usr/local/bin/sipp || true; \
|
|
rm -rf /tmp/sipp; \
|
|
fi; \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Traffic runner
|
|
COPY tools/scripts/traffic_runner.sh /usr/local/bin/traffic_runner
|
|
RUN chmod +x /usr/local/bin/traffic_runner
|
|
|
|
COPY flexric/etc/flexric /usr/local/etc/flexric/
|
|
COPY flexric/lib/flexric /usr/local/lib/flexric/
|
|
RUN echo "/usr/local/lib/flexric" > /etc/ld.so.conf.d/flexric.conf && ldconfig
|
|
|
|
ENTRYPOINT ["/bin/bash"] |