Commit cffa73bf authored by Robert Schmidt's avatar Robert Schmidt

RHEL8.2 dockerfiles: create intermediary build image

This commit creates an intermediary build image for all eNB, gNB, UE,
nrUE, RU targets (ran-build) after the image containing all RAN
compilation dependencies (ran-base). Then, the corresponding target
container images are just copied from the ran-build.

The only exception is phySim, which is still compiled independently, as
the build_oai would otherwise put all compiled files into
phy_simulators/build instead of ran_build/build. We do this at this
state to avoid any inconsistencies.
parent 48493ed1
......@@ -26,7 +26,7 @@
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest AS ran-build
FROM registry.access.redhat.com/ubi8/ubi:latest AS ran-base
ARG NEEDED_GIT_PROXY
ENV TZ=Europe/Paris
ENV BUILD_UHD_FROM_SOURCE=True
......
#/*
# * 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 Ubuntu 18.04
#
#---------------------------------------------------------------------
FROM ran-base:latest as ran-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --eNB --gNB --RU --UE --nrUE --ninja -w USRP --verbose-ci
......@@ -25,17 +25,9 @@
#
#---------------------------------------------------------------------
FROM ran-build:latest AS enb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
FROM ran-base:latest AS enb-base
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP --verbose-ci
FROM ran-build:latest AS enb-build
RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml && \
cp /oai-ran/docker/scripts/enb_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh
......@@ -78,10 +70,9 @@ COPY --from=enb-build \
/oai-ran/targets/bin/libparams_libconfig.so \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
/oai-ran/cmake_targets/ran_build/build/liboai_iqplayer.so \
/usr/local/lib/libprotobuf-c.so.1 \
./
COPY --from=enb-build \
COPY --from=enb-base \
/lib64/libconfig.so.9 \
/lib64/libblas.so.3 \
/lib64/liblapack.so.3 \
......@@ -100,12 +91,13 @@ COPY --from=enb-build \
/lib64/
# Now we are copying from builder-image the UHD files.
COPY --from=enb-build /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=enb-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=enb-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
COPY --from=enb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=enb-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=enb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=enb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
WORKDIR /usr/local/share/uhd/rfnoc
COPY --from=enb-build /usr/local/share/uhd/rfnoc/ .
COPY --from=enb-base /usr/local/share/uhd/rfnoc/ .
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
......
......@@ -25,17 +25,9 @@
#
#---------------------------------------------------------------------
FROM ran-build:latest AS gnb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
FROM ran-base:latest AS gnb-base
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP --verbose-ci
FROM ran-build:latest AS gnb-build
RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/gnb_parameters.yaml && \
cp /oai-ran/docker/scripts/gnb_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh
......@@ -83,10 +75,9 @@ COPY --from=gnb-build \
/oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \
/oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \
/oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \
/usr/local/lib/libprotobuf-c.so.1 \
./
COPY --from=gnb-build \
COPY --from=gnb-base \
/lib64/libconfig.so.9 \
/lib64/libforms.so.2 \
/lib64/libblas.so.3 \
......@@ -106,12 +97,13 @@ COPY --from=gnb-build \
/lib64/
# Now we are copying from builder-image the UHD files.
COPY --from=gnb-build /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=gnb-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=gnb-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=gnb-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=gnb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=gnb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
WORKDIR /usr/local/share/uhd/rfnoc
COPY --from=gnb-build /usr/local/share/uhd/rfnoc/ .
COPY --from=gnb-base /usr/local/share/uhd/rfnoc/ .
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
......
......@@ -25,17 +25,9 @@
#
#---------------------------------------------------------------------
FROM ran-build:latest AS ru-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
FROM ran-base:latest AS ru-base
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --RU --ninja -w USRP --verbose-ci
FROM ran-build:latest AS ru-build
RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml && \
cp /oai-ran/docker/scripts/lte_ru_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh
......@@ -75,7 +67,7 @@ COPY --from=ru-build \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
./
COPY --from=ru-build \
COPY --from=ru-base \
/lib64/libconfig.so.9 \
/lib64/libblas.so.3 \
/lib64/liblapack.so.3 \
......@@ -94,12 +86,12 @@ COPY --from=ru-build \
/lib64/
# Copying from the ran-build image the USRP needed packages
COPY --from=ru-build /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=ru-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=ru-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ru/bin
COPY --from=ru-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=ru-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=ru-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ru/bin
WORKDIR /usr/local/share/uhd/rfnoc
COPY --from=ru-build /usr/local/share/uhd/rfnoc/ .
COPY --from=ru-base /usr/local/share/uhd/rfnoc/ .
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
......
......@@ -25,17 +25,9 @@
#
#---------------------------------------------------------------------
FROM ran-build:latest AS lte-ue-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
FROM ran-base:latest AS lte-ue-base
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP --verbose-ci
FROM ran-build:latest AS lte-ue-build
RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_parameters.yaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_sim_parameters.yaml && \
......@@ -82,10 +74,9 @@ COPY --from=lte-ue-build \
/oai-ran/targets/bin/libparams_libconfig.so \
/oai-ran/cmake_targets/ran_build/build/libSIMU.so \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
/usr/local/lib/libprotobuf-c.so.1 \
./
COPY --from=lte-ue-build \
COPY --from=lte-ue-base \
/lib64/libconfig.so.9 \
/lib64/libblas.so.3 \
/lib64/liblapack.so.3 \
......@@ -104,12 +95,13 @@ COPY --from=lte-ue-build \
/lib64/
# Now we are copying from builder-image the UHD files.
COPY --from=lte-ue-build /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=lte-ue-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=lte-ue-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
COPY --from=lte-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=lte-ue-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=lte-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=lte-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
WORKDIR /usr/local/share/uhd/rfnoc
COPY --from=lte-ue-build /usr/local/share/uhd/rfnoc/ .
COPY --from=lte-ue-base /usr/local/share/uhd/rfnoc/ .
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
......
......@@ -25,18 +25,11 @@
#
#---------------------------------------------------------------------
FROM ran-build:latest AS nr-ue-build
FROM ran-base:latest AS nr-ue-base
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
FROM ran-build:latest AS nr-ue-build
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP --verbose-ci && \
cp /oai-ran/docker/scripts/nr_ue_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh
RUN cp /oai-ran/docker/scripts/nr_ue_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-nr-ue
......@@ -84,10 +77,9 @@ COPY --from=nr-ue-build \
/oai-ran/cmake_targets/ran_build/build/libldpc_optim.so \
/oai-ran/cmake_targets/ran_build/build/libldpc_optim8seg.so \
/oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \
/usr/local/lib/libprotobuf-c.so.1 \
./
COPY --from=nr-ue-build \
COPY --from=nr-ue-base \
/lib64/libconfig.so.9 \
/lib64/libblas.so.3 \
/lib64/liblapack.so.3 \
......@@ -107,12 +99,13 @@ COPY --from=nr-ue-build \
/lib64/
# Now we are copying from builder-image the UHD files.
COPY --from=nr-ue-build /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=nr-ue-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=nr-ue-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=nr-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=nr-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
WORKDIR /usr/local/share/uhd/rfnoc
COPY --from=nr-ue-build /usr/local/share/uhd/rfnoc/ .
COPY --from=nr-ue-base /usr/local/share/uhd/rfnoc/ .
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
......
......@@ -25,11 +25,7 @@
#
#---------------------------------------------------------------------
FROM ran-build:develop AS phy-sim-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
FROM ran-base:latest AS phy-sim-build
#run build_oai to build the target image
RUN /bin/sh oaienv && \
......
......@@ -26,7 +26,7 @@
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi7/ubi:latest AS ran-build
FROM registry.access.redhat.com/ubi7/ubi:latest AS ran-base
# Entitlements and RHSM configurations are Open-Shift Secret and ConfigMaps
# It is pre-requisite
......
......@@ -26,7 +26,7 @@
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest AS ran-build
FROM registry.access.redhat.com/ubi8/ubi:latest AS ran-base
# Entitlements and RHSM configurations are Open-Shift Secret and ConfigMaps
# It is pre-requisite
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment