Commit 60cba994 authored by Robert Schmidt's avatar Robert Schmidt

Ubuntu18 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.
parent 3355febd
......@@ -26,7 +26,7 @@
#---------------------------------------------------------------------
FROM ubuntu:bionic AS ran-build
FROM ubuntu:bionic AS ran-base
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
......
#/*
# * 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 . .
# build all targets so final targets can be created afterwards
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
......@@ -85,15 +77,17 @@ 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 \
./
# 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/lib/libuhd.so.3.15.0 /usr/local/lib
COPY --from=enb-build /usr/local/lib/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/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=enb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=enb-build \
COPY --from=enb-base \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 \
......
......@@ -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
......@@ -87,15 +79,17 @@ 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 \
./
# 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/lib/libuhd.so.3.15.0 /usr/local/lib
COPY --from=gnb-build /usr/local/lib/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/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=gnb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=gnb-build \
COPY --from=gnb-base \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 \
......
......@@ -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
......@@ -81,12 +73,12 @@ COPY --from=ru-build \
./
# Now we are copying from builder-image the UHD files.
COPY --from=ru-build /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=ru-build /usr/local/lib/libuhd.so.3.15.0 /usr/local/lib
COPY --from=ru-build /usr/local/lib/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/lib/libuhd.so.3.15.0 /usr/local/lib
COPY --from=ru-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ru/bin
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=ru-build \
COPY --from=ru-base \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 \
......
......@@ -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 && \
......@@ -89,16 +81,18 @@ 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 \
./
# 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/lib/libuhd.so.3.15.0 /usr/local/lib
COPY --from=lte-ue-build /usr/local/lib/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/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=lte-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=lte-ue-build \
COPY --from=lte-ue-base \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 \
......
......@@ -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 ubuntu:bionic as oai-nr-ue
......@@ -89,16 +82,18 @@ 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 \
./
# 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/lib/libuhd.so.3.15.0 /usr/local/lib
COPY --from=nr-ue-build /usr/local/lib/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/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=nr-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=nr-ue-build \
COPY --from=nr-ue-base \
/usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 \
/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 \
......
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