Skip to content
Snippets Groups Projects
Dockerfile.pcf.rhel8 3.95 KiB
Newer Older
Rohan's avatar
Rohan committed
#/*
# * 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 RHEL 8.2
#
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-pcf-builder

ARG NEEDED_GIT_PROXY

# 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 && \
    yum repolist --disablerepo=* && \
    subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms && \
    yum update -y && \
    yum install -y \
        psmisc \
        git \
        diffutils \
        file \
 && rm -rf /var/lib/apt/lists/*

# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN 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 && \
    rm /etc/pki/entitlement/*pem
RUN ./build_pcf --clean --Verbose --build-type Release --jobs && \
    mv /openair-pcf/build/pcf/build/pcf /openair-pcf/build/pcf/build/oai_pcf

#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-pcf
ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries
RUN yum update -y && \
    yum install -y --enablerepo="ubi-8-codeready-builder" \
    psmisc \
    procps-ng \
    net-tools \
    libevent && \
    rm -rf /var/lib/apt/lists/*

# Copying executable and generated libraries
WORKDIR /openair-pcf/bin
COPY --from=oai-pcf-builder \
    /openair-pcf/build/pcf/build/oai_pcf \
    /openair-pcf/scripts/entrypoint.sh \
    ./

COPY --from=oai-pcf-builder \
    /usr/local/lib64/libpistache.so.0 \
    /usr/local/lib/libnghttp2_asio.so \
    /usr/local/lib64/libyaml-cpp.so.0.7 \
    /usr/lib64/libconfig++.so.9 \
    /usr/lib64/libboost_system.so.1.66.0 \
    /usr/lib64/libboost_thread.so.1.66.0 \
    /usr/lib64/libboost_chrono.so.1.66.0 \
    /usr/local/lib/libnghttp2_asio.so.1 \
    /usr/lib64/

RUN ldconfig

# Copying template configuration files
# The configuration folder will be flat
WORKDIR /openair-pcf/etc
COPY --from=oai-pcf-builder \
    /openair-pcf/etc/pcf.conf \
    ./

WORKDIR /openair-pcf

# expose ports
EXPOSE 80/tcp 8080/tcp

ENTRYPOINT ["/openair-pcf/bin/entrypoint.sh"]
CMD ["/openair-pcf/bin/oai_pcf", "-c", "/openair-pcf/etc/pcf.conf", "-o"]