diff --git a/README.md b/README.md index 411561a..6000066 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ git clone http://github.com/OPENAIRINTERFACE/openair-k8s cd openair-k8s ``` +#### Ubuntu + +Follow this [guide](https://computingforgeeks.com/how-to-install-podman-on-ubuntu/) to install `podman`. + ### Building To build all OAI component images: ```sh diff --git a/hack/build_images b/hack/build_images index 0dad294..51faeb3 100755 --- a/hack/build_images +++ b/hack/build_images @@ -1,7 +1,21 @@ #!/bin/bash -source /etc/os-release -PLATFORM=${PLATFORM:-${ID#rh*}${VERSION_ID%.*}} +if [[ -f /etc/os-release ]]; then + source /etc/os-release + PLATFORM=${PLATFORM:-${ID#rh*}${VERSION_ID%.*}} +fi + +if [[ ${PLATFORM} == "rh"* ]]; then + DOCKERFILE_SUFIX=rh${PLATFORM} +else + PLATFORM="centos8" + DOCKERFILE_SUFIX=${PLATFORM} +fi + +if hash podman 2>/dev/null; then + USE_PODMAN=true +fi + KERNEL_VERSION=${KERNEL_VERSION:-$(uname -r)} KERNEL_VERSION=${KERNEL_VERSION%*.x86_64} REGISTRY=${REGISTRY:-registry.redhat.io} @@ -26,16 +40,16 @@ available images: exit 1 } -build_image() { +build_image_podman() { local IMAGE=$1 local TAG=$2 - local CLEAN_TAG=$(echo $TAG | sed -r 's/^v([0-9])/\1/') - + local CLEAN_TAG=$(echo $TAG | sed 's/^v\([0-9]\)/\1/') + echo "Building images using - Podman" # Default to building from Dockerfile. If there's a platform-specific Dockerfile # use that instead and append the platform name to the image tag. DOCKERFILE="Dockerfile" - if [ -f images/$IMAGE/Dockerfile.rh${PLATFORM} ]; then - DOCKERFILE="Dockerfile.rh${PLATFORM}" + if [ -f images/$IMAGE/Dockerfile.${DOCKERFILE_SUFIX} ]; then + DOCKERFILE="Dockerfile.${DOCKERFILE_SUFIX}" CLEAN_TAG="${CLEAN_TAG}.${PLATFORM}" fi @@ -56,6 +70,33 @@ build_image() { fi } +build_image_docker() { + local IMAGE=$1 + local TAG=$2 + local CLEAN_TAG=$(echo $TAG | sed 's/^v\([0-9]\)/\1/') + + echo "Building images using - Docker" + # Default to building from Dockerfile. If there's a platform-specific Dockerfile + # use that instead and append the platform name to the image tag. + DOCKERFILE="Dockerfile" + if [ -f images/$IMAGE/Dockerfile.${DOCKERFILE_SUFIX} ]; then + DOCKERFILE="Dockerfile.${DOCKERFILE_SUFIX}" + CLEAN_TAG="${CLEAN_TAG}.${PLATFORM}" + fi + + info "Building image $IMAGE:$CLEAN_TAG" + + docker build \ + --network=host \ + $BUILD_ARGS \ + --build-arg GIT_TAG=$TAG \ + --build-arg KERNEL_VERSION=$KERNEL_VERSION \ + --build-arg EURECOM_PROXY=$PROXY \ + -f images/$IMAGE/$DOCKERFILE \ + -t $IMAGE:$CLEAN_TAG \ + images/$IMAGE +} + # parse command line args POSITIONAL=() while [[ $# -gt 0 ]]; do @@ -81,7 +122,9 @@ if [ $# -ne 0 ]; then IMAGES=$* fi -podman login ${REGISTRY} +if [[ ${PLATFORM} == "rh"* ]]; then + podman login ${REGISTRY} +fi IMAGES="oai-build-base ${IMAGES/oai-build-base/}" @@ -92,11 +135,16 @@ for i in $IMAGES; do TAG=${i#*:} # if no git_tag specified, grep default from Dockerfile if [ "$IMG" = "$TAG" ]; then - if [ -f images/$IMG/Dockerfile.rh${PLATFORM} ]; then - TAG=$(grep -oP "ARG GIT_TAG=\K[a-zA-Z0-9.-]+" images/$IMG/Dockerfile.rh${PLATFORM} || echo "latest") + if [ -f images/$IMG/Dockerfile.${DOCKERFILE_SUFIX} ]; then + TAG=$(sed -n "s/ARG GIT_TAG=\(.*\)/\1/p" images/$IMG/Dockerfile.${DOCKERFILE_SUFIX} || echo "latest") else - TAG=$(grep -oP "ARG GIT_TAG=\K[a-zA-Z0-9.-]+" images/$IMG/Dockerfile || echo "latest") + TAG=$(sed -n "s/ARG GIT_TAG=\(.*\)/\1/p" images/$IMG/Dockerfile || echo "latest") fi fi - build_image $IMG $TAG + # decide whether or not to use docker or podman + if [[ -z $USE_PODMAN ]]; then + build_image_docker $IMG $TAG + else + build_image_podman $IMG $TAG + fi done diff --git a/images/oai-build-base/Dockerfile.centos8 b/images/oai-build-base/Dockerfile.centos8 new file mode 100644 index 0000000..5601b88 --- /dev/null +++ b/images/oai-build-base/Dockerfile.centos8 @@ -0,0 +1,91 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM centos:8 + +ARG GIT_TAG=latest +LABEL name="oai-build-base" \ + version="${GIT_TAG}.centos8" \ + io.k8s.description="Image containing all build dependencies for openairinterface5g and openair-cn." + +WORKDIR /root +RUN yum -y install --enablerepo="PowerTools" \ + git make cmake gcc gcc-c++ autoconf automake bc bison flex libtool patch \ + atlas-devel \ + blas \ + blas-devel \ + boost \ + boost-devel \ + bzip2-devel \ + check \ + check-devel \ + diffutils \ + elfutils-libelf-devel \ + file \ + gflags-devel \ + glog-devel \ + gmp-devel \ + gnutls-devel \ + guile-devel \ + kernel-devel \ + kernel-headers \ + lapack \ + lapack-devel \ + libasan \ + libconfig-devel \ + libevent-devel \ + libffi-devel \ + libgcrypt-devel \ + libidn-devel \ + libidn2-devel \ + libtool \ + libusb-devel \ + libusbx-devel \ + libxml2-devel \ + libXpm-devel \ + libxslt-devel \ + libyaml-devel \ + lksctp-tools \ + lksctp-tools-devel \ + lz4-devel \ + mariadb-devel \ + nettle-devel \ + numactl-devel \ + openssh-clients \ + openssh-server \ + openssl \ + openssl-devel \ + pkgconfig \ + protobuf \ + protobuf-c \ + protobuf-c-compiler \ + protobuf-c-devel \ + psmisc \ + python2 \ + python2-docutils \ + python2-requests \ + vim-common \ + xz-devel \ + zlib-devel \ + && yum install -y http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xforms-1.2.4-5.el7.x86_64.rpm \ + && yum install -y http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xforms-devel-1.2.4-5.el7.x86_64.rpm \ + && yum clean all -y \ + && rm -rf /var/cache/yum \ + && pip2 install --user mako pexpect + +# build packages not present in CentOS/EPEL repos +COPY patches patches/ +COPY scripts scripts/ +RUN scripts/build_missing_packages diff --git a/images/oai-enb/Dockerfile.centos8 b/images/oai-enb/Dockerfile.centos8 new file mode 100644 index 0000000..9fe0e55 --- /dev/null +++ b/images/oai-enb/Dockerfile.centos8 @@ -0,0 +1,81 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=v1.1.1 + +WORKDIR /root + +RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi + +RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git +COPY patches patches/ +RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_and_rbtool.patch \ + && patch -p1 -d openairinterface5g < patches/disable_sched_fifo_fail_exits.patch +RUN cd openairinterface5g/cmake_targets \ + && ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \ + && ./build_oai -c --eNB -w USRP --verbose-compile + + +FROM centos:8 +LABEL name="oai-enb" \ + version="$GIT_TAG" \ + io.k8s.description="openairinterface5g eNB $GIT_TAG." + +RUN REPOLIST="PowerTools" \ + PKGLIST="boost libconfig lksctp-tools protobuf-c iproute iputils procps-ng bind-utils" \ + # && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \ + && yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \ + && yum -y install http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xforms-1.2.4-5.el7.x86_64.rpm \ + && yum -y clean all \ + && rm -rf /var/cache/yum + +ENV APP_ROOT=/opt/oai-enb +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/lte-softmodem ${APP_ROOT}/bin/ +COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/*.so* /lib64/ +COPY --from=builder /usr/local/lib64 /lib64/ +COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin/ +COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd/ +RUN cd /lib64 \ + && ln -sf liboai_eth_transpro.so liboai_transpro.so \ + && ln -sf liboai_usrpdevif.so liboai_device.so \ + && ln -sf libuhd.so.3.13 libuhd.so.3 \ + && ln -sf libuhd.so.3 libuhd.so +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +USER 10001 +WORKDIR ${APP_ROOT} + +# S1U, GTP/UDP +EXPOSE 2152/udp +# ? +EXPOSE 22100/tcp +# S1C, SCTP/UDP +EXPOSE 36412/udp +# X2C, SCTP/UDP +EXPOSE 36422/udp +# IF5 / ORI (control) +EXPOSE 50000/udp +# IF5 / ECPRI (data) +EXPOSE 50001/udp + +CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"] +ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"] diff --git a/images/oai-gnb/Dockerfile.centos8 b/images/oai-gnb/Dockerfile.centos8 new file mode 100644 index 0000000..26c8a1f --- /dev/null +++ b/images/oai-gnb/Dockerfile.centos8 @@ -0,0 +1,80 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=develop-nr + +WORKDIR /root + +RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi + +RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git +COPY patches patches/ +RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_rbtools_ue_ip.patch +RUN cd openairinterface5g/cmake_targets \ + && ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \ + && ./build_oai --gNB -w USRP --verbose-compile + + +FROM centos:8 +LABEL name="oai-gnb" \ + version="$GIT_TAG" \ + io.k8s.description="openairinterface5g gNB $GIT_TAG." + +RUN REPOLIST="PowerTools" \ + && PKGLIST="atlas blas boost lapack libconfig libusb libusbx lksctp-tools protobuf-c iproute iputils procps-ng bind-utils" \ + # && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important \ + && yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \ + && yum install -y http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xforms-1.2.4-5.el7.x86_64.rpm \ + && yum -y clean all \ + && rm -rf /var/cache/yum + +ENV APP_ROOT=/opt/oai-gnb +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem ${APP_ROOT}/bin/ +COPY --from=builder /root/openairinterface5g/cmake_targets/ran_build/build/*.so* /lib64/ +COPY --from=builder /usr/local/lib64 /lib64/ +COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin/ +COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd/ +RUN cd /lib64 \ + && ln -sf liboai_eth_transpro.so liboai_transpro.so \ + && ln -sf liboai_usrpdevif.so liboai_device.so \ + && ln -sf libuhd.so.3.13 libuhd.so.3 \ + && ln -sf libuhd.so.3 libuhd.so +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +USER 10001 +WORKDIR ${APP_ROOT} + +# S1U, GTP/UDP +EXPOSE 2152/udp +# ? +EXPOSE 22100/tcp +# S1C, SCTP/UDP +EXPOSE 36412/udp +# X2C, SCTP/UDP +EXPOSE 36422/udp +# IF5 / ORI (control) +EXPOSE 50000/udp +# IF5 / ECPRI (data) +EXPOSE 50001/udp + +CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"] +ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"] diff --git a/images/oai-hss/Dockerfile.centos8 b/images/oai-hss/Dockerfile.centos8 new file mode 100644 index 0000000..2e37b69 --- /dev/null +++ b/images/oai-hss/Dockerfile.centos8 @@ -0,0 +1,68 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=develop-vco3 + +WORKDIR /root + +RUN git clone --depth=1 --branch=$GIT_TAG https://github.com/OPENAIRINTERFACE/openair-cn.git +COPY patches patches/ +RUN patch -p1 -d openair-cn < patches/enable_sudo-less_build.patch \ + && patch -p1 -d openair-cn < patches/disable_distro_check_and_rpm_install.patch \ + && patch -p1 -d openair-cn < patches/fix_libpistache_lib_path.patch +RUN cd openair-cn/scripts \ + && ln -sf /usr/local/bin/asn1c_cn /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_cn /usr/local/share/asn1c \ + && rm -rf /usr/local/lib/freeDiameter /usr/local/lib/libfd* \ + && OPENAIRCN_DIR=$(dirname $(pwd)) ./build_hss_rel14 --check-installed-software --force \ + && OPENAIRCN_DIR=$(dirname $(pwd)) ./build_hss_rel14 -v + + +FROM centos:8 +LABEL name="oai-hss" \ + version="$GIT_TAG" \ + io.k8s.description="openair-cn HSS $GIT_TAG." + +RUN REPOLIST=PowerTools \ + PKGLIST="libconfig libidn mariadb-devel lksctp-tools mysql iproute iputils procps-ng bind-utils" && \ + # yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \ + yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} && \ + yum -y clean all + +ENV APP_ROOT=/opt/oai-hss +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} + +COPY --from=builder /root/openair-cn/build/hss_rel14/bin/hss ${APP_ROOT}/bin/oai_hss/ +COPY --from=builder /usr/local/lib/libfd* /lib64/ +COPY --from=builder /usr/local/lib/freeDiameter/* /usr/local/lib/freeDiameter/ +COPY --from=builder /usr/local/lib64/libcassandra* /lib64/ +COPY --from=builder /usr/local/lib64/libuv.so /lib64/ +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +USER 10001 +WORKDIR ${APP_ROOT} + +# expose ports configured in hss_fd.conf +EXPOSE 9042/tcp 5868/tcp 9080/tcp 9081/tcp + +VOLUME ["${APP_ROOT}/certs"] + +CMD ["/opt/oai-hss/bin/oai_hss", "-j", "/opt/oai-hss/etc/hss_rel14.json"] +ENTRYPOINT ["/opt/oai-hss/bin/entrypoint.sh"] diff --git a/images/oai-mme/Dockerfile.centos8 b/images/oai-mme/Dockerfile.centos8 new file mode 100644 index 0000000..b52d6b5 --- /dev/null +++ b/images/oai-mme/Dockerfile.centos8 @@ -0,0 +1,65 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=develop-vco3 + +WORKDIR /root + +RUN git clone --depth=1 --branch=$GIT_TAG https://github.com/OPENAIRINTERFACE/openair-cn.git +COPY patches patches/ +RUN patch -p1 -d openair-cn < patches/enable_sudo-less_build.patch \ + && patch -p1 -d openair-cn < patches/disable_distro_check_and_rpm_install.patch +RUN cd openair-cn/scripts \ + && ln -sf /usr/local/bin/asn1c_cn /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_cn /usr/local/share/asn1c \ + && rm -rf /usr/local/lib/freeDiameter /usr/local/lib/libfd* \ + && OPENAIRCN_DIR=$(dirname $(pwd)) ./build_mme --check-installed-software --force \ + && OPENAIRCN_DIR=$(dirname $(pwd)) ./build_mme -c -v -b Debug + + +FROM centos:8 +LABEL name="oai-mme" \ + version="$GIT_TAG" \ + io.k8s.description="openair-cn MME $GIT_TAG." + +RUN REPOLIST=PowerTools \ + PKGLIST="libconfig libasan libidn lksctp-tools iproute iputils procps-ng bind-utils" && \ + # yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \ + yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} && \ + yum -y clean all + +ENV APP_ROOT=/opt/oai-mme +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openair-cn/build/mme/build/mme ${APP_ROOT}/bin/ +COPY --from=builder /usr/local/lib/libfd* /lib64/ +COPY --from=builder /usr/local/lib/freeDiameter/* /usr/local/lib/freeDiameter/ +COPY --from=builder /usr/local/lib/liblfds* /usr/lib64/ +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +#USER 10001 +WORKDIR ${APP_ROOT} + +# expose ports +EXPOSE 3870/tcp 5870/tcp 2123/udp + +VOLUME ["${APP_ROOT}/certs"] + +CMD ["/opt/oai-mme/bin/mme", "-c", "/opt/oai-mme/etc/mme.conf"] +ENTRYPOINT ["/opt/oai-mme/bin/entrypoint.sh"] diff --git a/images/oai-nrue/Dockerfile.centos8 b/images/oai-nrue/Dockerfile.centos8 new file mode 100644 index 0000000..dd62e06 --- /dev/null +++ b/images/oai-nrue/Dockerfile.centos8 @@ -0,0 +1,79 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=develop-nr + +WORKDIR /root + +RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi + +RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git +COPY patches patches/ +RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_rbtools_ue_ip.patch +RUN cd openairinterface5g/cmake_targets \ + && ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \ + && ./build_oai --nrUE -w USRP --verbose-compile + + +FROM centos:8 +LABEL name="oai-nrue" \ + version="$GIT_TAG" \ + io.k8s.description="openairinterface5g nrUE $GIT_TAG." + +RUN REPOLIST="PowerTools" \ + && PKGLIST="atlas blas boost lapack libconfig libusb libusbx lksctp-tools protobuf-c iproute iputils procps-ng bind-utils" \ + # && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important \ + && yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \ + && yum install -y http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xforms-1.2.4-5.el7.x86_64.rpm \ + && yum -y clean all \ + && rm -rf /var/cache/yum + +ENV APP_ROOT=/opt/oai-nrue +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem ${APP_ROOT}/bin/ +COPY --from=builder /root/openairinterface5g/cmake_targets/ran_build/build/*.so* /lib64/ +COPY --from=builder /usr/local/lib64 /lib64/ +COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin/ +COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd/ +RUN cd /lib64 \ + && ln -sf liboai_eth_transpro.so liboai_transpro.so \ + && ln -sf liboai_usrpdevif.so liboai_device.so \ + && ln -sf libuhd.so.3.13 libuhd.so.3 \ + && ln -sf libuhd.so.3 libuhd.so +COPY scripts ${APP_ROOT}/bin/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +USER 10001 +WORKDIR ${APP_ROOT} + +# S1U, GTP/UDP +EXPOSE 2152/udp +# ? +EXPOSE 22100/tcp +# S1C, SCTP/UDP +EXPOSE 36412/udp +# X2C, SCTP/UDP +EXPOSE 36422/udp +# IF5 / ORI (control) +EXPOSE 50000/udp +# IF5 / ECPRI (data) +EXPOSE 50001/udp + +CMD ["/opt/oai-gnb/bin/nr-uesoftmodem", "--numerology", "1", "-r", "106", "--phy-test", "-C", "3510000000"] +ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"] diff --git a/images/oai-spgwc/Dockerfile.centos8 b/images/oai-spgwc/Dockerfile.centos8 new file mode 100644 index 0000000..3f2f343 --- /dev/null +++ b/images/oai-spgwc/Dockerfile.centos8 @@ -0,0 +1,57 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=develop-vco3 + +WORKDIR /root + +RUN git clone --depth=1 --branch=$GIT_TAG https://github.com/OPENAIRINTERFACE/openair-cn-cups.git +RUN git clone --depth=1 --branch=master https://github.com/gabime/spdlog.git openair-cn-cups/build/ext/spdlog +COPY patches patches/ +RUN patch -p1 -d openair-cn-cups < patches/enable_sudo-less_build.patch +RUN cd openair-cn-cups/build/scripts \ + && ./build_spgwc -c -v -b RelWithDebInfo -j + + +FROM centos:8 +LABEL name="oai-spgwc" \ + version="$GIT_TAG" \ + io.k8s.description="openair-cn-cups S/P-GW-C $GIT_TAG" + +RUN REPOLIST=PowerTools \ + PKGLIST="boost libasan libconfig libevent gflags-devel glog-devel iproute iputils procps-ng bind-utils" && \ + # yum -y update-minimal --setopt=tsflags=nodocs --security --sec-severity=Important --sec-severity=Critical && \ + yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} && \ + yum -y clean all + +ENV APP_ROOT=/opt/oai-spgwc +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openair-cn-cups/build/spgw_c/build/spgwc ${APP_ROOT}/bin/ +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +#USER 10001 +WORKDIR ${APP_ROOT} + +# expose ports +EXPOSE 2123/udp 8805/udp + +CMD ["/opt/oai-spgwc/bin/spgwc", "-c", "/opt/oai-spgwc/etc/spgw_c.conf", "-o"] +ENTRYPOINT ["/opt/oai-spgwc/bin/entrypoint.sh"] + diff --git a/images/oai-spgwu/Dockerfile.centos8 b/images/oai-spgwu/Dockerfile.centos8 new file mode 100644 index 0000000..fe288ec --- /dev/null +++ b/images/oai-spgwu/Dockerfile.centos8 @@ -0,0 +1,55 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=develop-vco3 + +WORKDIR /root + +RUN git clone --depth=1 --branch=$GIT_TAG https://github.com/OPENAIRINTERFACE/openair-cn-cups.git +RUN git clone --depth=1 --branch=master https://github.com/gabime/spdlog.git openair-cn-cups/build/ext/spdlog +COPY patches patches/ +RUN patch -p1 -d openair-cn-cups < patches/enable_sudo-less_build.patch +RUN cd openair-cn-cups/build/scripts \ + && ./build_spgwu -c -v -b RelWithDebInfo -j + +FROM centos:8 +LABEL name="oai-spgwu" \ + version="$GIT_TAG" \ + io.k8s.description="openair-cn-cups S/P-GW-U $GIT_TAG" + +RUN REPOLIST=PowerTools \ + PKGLIST="boost libasan libconfig libevent gflags-devel glog-devel iproute iputils iptables procps-ng bind-utils" && \ + # yum -y update-minimal --setopt=tsflags=nodocs --security --sec-severity=Important --sec-severity=Critical && \ + yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} && \ + yum -y clean all + +ENV APP_ROOT=/opt/oai-spgwu +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openair-cn-cups/build/spgw_u/build/spgwu ${APP_ROOT}/bin/ +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +#USER 10001 +WORKDIR ${APP_ROOT} + +# expose ports +EXPOSE 2152/udp 8805/udp + +CMD ["/opt/oai-spgwu/bin/spgwu", "-c", "/opt/oai-spgwu/etc/spgw_u.conf", "-o"] +ENTRYPOINT ["/opt/oai-spgwu/bin/entrypoint.sh"] diff --git a/images/oai-ue/Dockerfile.centos8 b/images/oai-ue/Dockerfile.centos8 new file mode 100644 index 0000000..b25b475 --- /dev/null +++ b/images/oai-ue/Dockerfile.centos8 @@ -0,0 +1,72 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=v1.1.1 + +WORKDIR /root + +RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi +RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git +COPY patches patches/ +RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_and_rbtool.patch \ + && patch -p1 -d openairinterface5g < patches/el8_support_ue_ip_module.patch +RUN cd openairinterface5g/cmake_targets \ + && ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \ + && ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \ + && ./build_oai -c --UE -w USRP --verbose-compile + + +FROM centos:8 +LABEL name="oai-ue" \ + version="$GIT_TAG" \ + io.k8s.description="openairinterface5g UE $GIT_TAG." + +RUN REPOLIST="PowerTools" \ + && PKGLIST="atlas blas boost lapack libconfig lksctp-tools protobuf-c iproute iputils procps-ng bind-utils" \ + # && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important \ + && yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \ + && yum install -y http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xforms-1.2.4-5.el7.x86_64.rpm \ + && yum -y clean all \ + && rm -rf /var/cache/yum + +ENV APP_ROOT=/opt/oai-ue +ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT} +COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/lte-uesoftmodem ${APP_ROOT}/bin/ +COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/*.so* /lib64/ +COPY --from=builder /usr/local/lib64 /lib64/ +COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin/ +COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd/ +RUN cd /lib64 \ + && ln -sf liboai_eth_transpro.so liboai_transpro.so \ + && ln -sf liboai_usrpdevif.so liboai_device.so \ + && ln -sf libuhd.so.3.13 libuhd.so.3 \ + && ln -sf libuhd.so.3 libuhd.so +COPY scripts ${APP_ROOT}/bin/ +COPY configs ${APP_ROOT}/etc/ +RUN chmod -R u+x ${APP_ROOT} && \ + chgrp -R 0 ${APP_ROOT} && \ + chmod -R g=u ${APP_ROOT} /etc/passwd +USER 10001 +WORKDIR ${APP_ROOT} + +# expose ports from ue.conf +EXPOSE 50000/udp 50001/udp + +CMD ["/opt/oai-ue/bin/lte-uesoftmodem", \ + "-C", "2680000000", "-r", "25", "--nokrnmod", "1", \ + "-O", "/opt/oai-ue/etc/ue.conf"] +ENTRYPOINT ["/opt/oai-ue/bin/entrypoint.sh"] diff --git a/images/rt-tests-cyclictest/Dockerfile.centos8 b/images/rt-tests-cyclictest/Dockerfile.centos8 new file mode 100644 index 0000000..db271a9 --- /dev/null +++ b/images/rt-tests-cyclictest/Dockerfile.centos8 @@ -0,0 +1,38 @@ +# Copyright 2020 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +# 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. + +FROM oai-build-base:latest.centos8 AS builder + +ARG GIT_TAG=latest + +RUN git clone --depth=1 --branch=stable/v1.0 git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git +RUN cd rt-tests && make cyclictest + +FROM centos:8 + +COPY --from=builder /root/rt-tests/cyclictest /usr/local/bin/cyclictest/ + +ARG CORES=1 +ARG CORE_LIST=2 +ARG DURATION=1m + +ENV CORES="${CORES}" +ENV CORE_LIST="${CORE_LIST}" +ENV DURATION="${DURATION}" +USER root + +ENTRYPOINT ["/bin/bash"] +CMD ["-c", "taskset -c ${CORE_LIST} cyclictest -q -D ${DURATION} -p 99 -t ${CORES} -h 30 -m -a ${CORE_LIST}"] +