Dockerfiles hardcoded one copy operation to x86; generalize to capture
ARM as well. Since the target directory cannot have any globs, we need
to manually check the right directory, then move the file.
Note that this is only necessary since we are forced to switch the
compiler, as Ubuntu's default gcc-11 does not work with FlexRIC. When
upgrading to Ubuntu 24, these lines should disappear and asan be
installed as normal. See commit 94497435e7 ("Upgrade CI images to
Ubuntu 22").
91 lines
3.6 KiB
Docker
91 lines
3.6 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 Ubuntu20.04
|
|
#
|
|
#---------------------------------------------------------------------
|
|
|
|
FROM ran-base:latest AS gnb-base
|
|
|
|
FROM ran-build:latest AS gnb-build
|
|
|
|
|
|
FROM ubuntu:jammy AS oai-nr-cuup
|
|
ARG BUILD_OPTION
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV TZ=Europe
|
|
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
|
libsctp1 \
|
|
libconfig9 \
|
|
iproute2 \
|
|
net-tools \
|
|
openssl && \
|
|
# if the --sanitize option was used to build, additional packages are required
|
|
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
|
#libasan5 \ see below
|
|
libubsan1 \
|
|
liblapacke; fi' && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# we select another compile (gcc-12) for compilation, requiring another libasan
|
|
# library version. Installing it above would install the wrong version. Hence,
|
|
# copy the right version from ran-build. When upgrading to Ubuntu24, install
|
|
# the correct one above!
|
|
# note: this dockerfile should work for both x86 and arm, hence the glob below
|
|
# which should either match "x86_64" (x86) or "aarch64" (ARM); since the target
|
|
# directory needs to be also one of those two, but globs don't work in target
|
|
# directories, work around this with mv
|
|
COPY --from=gnb-build /usr/lib/*-linux-gnu/libasan.so.8.0.0 /usr/lib/
|
|
ARG TARGETPLATFORM
|
|
RUN case "${TARGETPLATFORM}" in \
|
|
"linux/amd64") TARGET_DIR=x86_64-linux-gnu ;; \
|
|
"linux/arm64") TARGET_DIR=aarch64-linux-gnu ;; \
|
|
*) exit 1 ;; \
|
|
esac; \
|
|
mv /usr/lib/libasan.so.8.0.0 /usr/lib/$TARGET_DIR/libasan.so.8.0.0
|
|
## Copy E2 SM models
|
|
COPY --from=gnb-build /usr/local/lib/flexric /usr/local/lib/flexric
|
|
|
|
WORKDIR /opt/oai-gnb/bin
|
|
COPY --from=gnb-build \
|
|
/oai-ran/cmake_targets/ran_build/build/nr-cuup \
|
|
./
|
|
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
|
|
COPY --from=gnb-build \
|
|
/oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \
|
|
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \
|
|
/usr/local/lib/
|
|
|
|
RUN ldconfig && ldd /opt/oai-gnb/bin/nr-cuup
|
|
|
|
# Create directory for configuration files
|
|
WORKDIR /opt/oai-gnb/etc
|
|
|
|
WORKDIR /opt/oai-gnb
|
|
COPY --from=gnb-base /tini /tini
|
|
ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-gnb/bin/entrypoint.sh"]
|
|
CMD ["/opt/oai-gnb/bin/nr-cuup", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|