Newer
Older
#/*
# * 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 PCF service
# Valid for UBI 9.x | RHEL 9.x
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi9/ubi:latest AS oai-pcf-builder
# Copy the entitlements
COPY ./etc-pki-entitlement /etc/pki/entitlement
# Copy the subscription manager configurations
COPY ./rhsm-conf /etc/rhsm
COPY ./rhsm-ca /etc/rhsm/ca
RUN rm -f /etc/rhsm-host && \
subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms && \
dnf update -y && \
# here just to display the current version
dnf install -y \
libasan \

Raphael Defosseux
committed
file && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
RUN git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false
# Copying source code
WORKDIR /openair-pcf
COPY . /openair-pcf
# Installing and Building PCF
WORKDIR /openair-pcf/build/scripts
RUN ./build_pcf --install-deps --force
RUN ldconfig && \
./build_pcf --clean --Verbose --build-type Release --jobs && \

Raphael Defosseux
committed
ldd /openair-pcf/build/pcf/build/pcf && \
mv /openair-pcf/build/pcf/build/pcf /openair-pcf/build/pcf/build/oai_pcf && \
# Remove entitlements and Subscription Manager configs
rm -rf /etc/pki/entitlement && \
rm -rf /etc/rhsm
FROM mikefarah/yq:latest as yq-source
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest as oai-pcf
# Copy the entitlements
COPY ./etc-pki-entitlement /etc/pki/entitlement
# Copy the subscription manager configurations
COPY ./rhsm-conf /etc/rhsm
COPY ./rhsm-ca /etc/rhsm/ca
# We install some debug tools for the moment in addition of mandatory libraries
RUN rm -f /etc/rhsm-host && \
microdnf update -y && \
microdnf install -y \
# Debug Tools that are not mandatory

Raphael Defosseux
committed
procps-ng \

Raphael Defosseux
committed
net-tools \
iputils \
tcpdump \
# Mandatory packages for the NF to run
# libasan \
libicu \
boost \
libevent \
microdnf clean all -y && \
rm -rf /var/cache/yum /var/cache/dnf && \
# Remove entitlements and Subscription Manager configs
rm -rf /etc/pki/entitlement && \
rm -rf /etc/rhsm
# Copying executable and generated libraries
WORKDIR /openair-pcf/bin
COPY --from=oai-pcf-builder \
/openair-pcf/build/pcf/build/oai_pcf \
/openair-pcf/scripts/healthcheck.sh \
COPY --from=yq-source /usr/bin/yq /usr/bin
# Copying only the packages built from source
/usr/local/lib64/libpistache.so.0 \
/usr/local/lib/libnghttp2_asio.so \
/usr/local/lib/libnghttp2_asio.so.1 \
/usr/local/lib64/libspdlog.so \
/usr/local/lib64/libfmt.so \
/usr/local/lib64/libyaml-cpp.so.0.* \

Raphael Defosseux
committed
RUN ldconfig && \
ldd /openair-pcf/bin/oai_pcf
# Copying template configuration files
# The configuration folder will be flat
WORKDIR /openair-pcf/etc
COPY --from=oai-pcf-builder \
/openair-pcf/etc/config.yaml \
./
WORKDIR /openair-pcf
# expose ports
EXPOSE 80/tcp 8080/tcp
# healthcheck
HEALTHCHECK --interval=10s \
--timeout=15s \
--retries=6 \
CMD /openair-pcf/bin/healthcheck.sh
CMD ["/openair-pcf/bin/oai_pcf", "-c", "/openair-pcf/etc/config.yaml", "-o"]