From 69b3ecb912ab61dfb404857baa1534bb0b117e75 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 3 Mar 2021 14:58:29 +0100 Subject: [PATCH] osmo-*-latest: support centos8 Add a new centos8-obs-latest container with shared code (just like debian-stretch-obs-latest) and adjust the package install blocks in osmo-*-latest. Related: OS#5049 Change-Id: I274b31d4903df07e99fd434af25bdb72991f6923 --- centos8-obs-latest/Dockerfile | 21 ++++++++++++++ centos8-obs-latest/Makefile | 3 ++ jenkins-common.sh | 1 + osmo-bsc-latest/Dockerfile | 20 ++++++++++---- osmo-bts-latest/Dockerfile | 20 ++++++++++---- osmo-cbc-latest/Dockerfile | 17 +++++++++--- osmo-gbproxy-latest/Dockerfile | 1 + osmo-ggsn-latest/Dockerfile | 50 ++++++++++++++++++++-------------- osmo-hlr-latest/Dockerfile | 19 +++++++++---- osmo-mgw-latest/Dockerfile | 17 +++++++++--- osmo-msc-latest/Dockerfile | 17 +++++++++--- osmo-nitb-latest/Dockerfile | 1 + osmo-pcu-latest/Dockerfile | 17 +++++++++--- osmo-sgsn-latest/Dockerfile | 17 +++++++++--- osmo-sip-latest/Dockerfile | 17 +++++++++--- osmo-smlc-latest/Dockerfile | 17 +++++++++--- osmo-stp-latest/Dockerfile | 17 +++++++++--- 17 files changed, 205 insertions(+), 67 deletions(-) create mode 100644 centos8-obs-latest/Dockerfile create mode 100644 centos8-obs-latest/Makefile diff --git a/centos8-obs-latest/Dockerfile b/centos8-obs-latest/Dockerfile new file mode 100644 index 00000000..4b2357b3 --- /dev/null +++ b/centos8-obs-latest/Dockerfile @@ -0,0 +1,21 @@ +ARG REGISTRY=docker.io +ARG UPSTREAM_DISTRO=centos:centos8 +FROM ${REGISTRY}/${UPSTREAM_DISTRO} +# Arguments used after FROM must be specified again +ARG OSMOCOM_REPO_MIRROR="http://download.opensuse.org" + +# Let package metadata expire after 60 seconds instead of 48 hours +RUN echo "metadata_expire=60" >> /etc/dnf/dnf.conf && cat /etc/dnf/dnf.conf + +# Make additional development libraries available from PowerTools and set up +# Osmocom latest OBS repository +RUN dnf install -y dnf-utils wget && \ + yum config-manager --set-enabled powertools && \ + cd /etc/yum.repos.d/ && \ + wget $OSMOCOM_REPO_MIRROR/repositories/network:osmocom:latest/CentOS_8/network:osmocom:latest.repo + +RUN dnf install -y \ + telnet + +# Invalidate cache once the repository is updated +ADD $OSMOCOM_REPO_MIRROR/repositories/network:/osmocom:/latest/CentOS_8/repodata/repomd.xml /tmp/repomd.xml diff --git a/centos8-obs-latest/Makefile b/centos8-obs-latest/Makefile new file mode 100644 index 00000000..cba5cee8 --- /dev/null +++ b/centos8-obs-latest/Makefile @@ -0,0 +1,3 @@ +UPSTREAM_DISTRO:=centos:centos8 +DISTRO:=centos8 +include ../make/Makefile diff --git a/jenkins-common.sh b/jenkins-common.sh index b8fc3a21..6c27fae7 100644 --- a/jenkins-common.sh +++ b/jenkins-common.sh @@ -7,6 +7,7 @@ docker_image_exists() { docker_depends() { case "$1" in + osmo-*-latest-centos8) echo "centos8-obs-latest" ;; osmo-*-centos8) echo "centos8-build" ;; osmo-*-latest) echo "debian-stretch-obs-latest" ;; osmo-*) echo "debian-stretch-build" ;; diff --git a/osmo-bsc-latest/Dockerfile b/osmo-bsc-latest/Dockerfile index bbc3934c..3352ed2c 100644 --- a/osmo-bsc-latest/Dockerfile +++ b/osmo-bsc-latest/Dockerfile @@ -2,12 +2,22 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-bsc \ - osmo-bsc-ipaccess-utils && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-bsc \ + osmo-bsc-ipaccess-utils && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-bsc \ + osmo-bsc-ipaccess-utils \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-bts-latest/Dockerfile b/osmo-bts-latest/Dockerfile index b576e725..6e835d5b 100644 --- a/osmo-bts-latest/Dockerfile +++ b/osmo-bts-latest/Dockerfile @@ -2,12 +2,22 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-bts-trx \ - osmo-bts-virtual && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-bts-trx \ + osmo-bts-virtual && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-bts \ + osmo-bts-virtual \ + ;; \ + esac ADD respawn.sh /usr/local/bin/respawn.sh diff --git a/osmo-cbc-latest/Dockerfile b/osmo-cbc-latest/Dockerfile index 91458d8e..d919dae8 100644 --- a/osmo-cbc-latest/Dockerfile +++ b/osmo-cbc-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-cbc && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-cbc && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-cbc \ + ;; \ + esac WORKDIR /data diff --git a/osmo-gbproxy-latest/Dockerfile b/osmo-gbproxy-latest/Dockerfile index 22904a1b..7c729a5a 100644 --- a/osmo-gbproxy-latest/Dockerfile +++ b/osmo-gbproxy-latest/Dockerfile @@ -2,6 +2,7 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO RUN case "$DISTRO" in \ debian*) \ diff --git a/osmo-ggsn-latest/Dockerfile b/osmo-ggsn-latest/Dockerfile index 82bbef26..0da9703c 100644 --- a/osmo-ggsn-latest/Dockerfile +++ b/osmo-ggsn-latest/Dockerfile @@ -2,28 +2,38 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO +# Install additional debian depends for kernel module test (OS#3208) # Disable update-initramfs to save time during apt-get install -RUN ln -s /bin/true /usr/local/bin/update-initramfs && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - bc \ - bison \ - bridge-utils \ - busybox-static \ - ca-certificates \ - flex \ - gcc \ - git \ - libc6-dev \ - libelf-dev \ - libssl-dev \ - linux-image-amd64 \ - make \ - osmo-ggsn \ - pax-utils \ - qemu-system-x86 && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + ln -s /bin/true /usr/local/bin/update-initramfs && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + bc \ + bison \ + bridge-utils \ + busybox-static \ + ca-certificates \ + flex \ + gcc \ + git \ + libc6-dev \ + libelf-dev \ + libssl-dev \ + linux-image-amd64 \ + make \ + osmo-ggsn \ + pax-utils \ + qemu-system-x86 && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-ggsn \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-hlr-latest/Dockerfile b/osmo-hlr-latest/Dockerfile index ed83ac3a..ece7aa63 100644 --- a/osmo-hlr-latest/Dockerfile +++ b/osmo-hlr-latest/Dockerfile @@ -2,12 +2,21 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - libdbd-sqlite3 \ - osmo-hlr && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + libdbd-sqlite3 \ + osmo-hlr && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-hlr \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-mgw-latest/Dockerfile b/osmo-mgw-latest/Dockerfile index 52cca6e9..5b01fe80 100644 --- a/osmo-mgw-latest/Dockerfile +++ b/osmo-mgw-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-mgw && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-mgw && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-mgw \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-msc-latest/Dockerfile b/osmo-msc-latest/Dockerfile index 4ff86d33..d2c11078 100644 --- a/osmo-msc-latest/Dockerfile +++ b/osmo-msc-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-msc && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-msc && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-msc \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-nitb-latest/Dockerfile b/osmo-nitb-latest/Dockerfile index c711f8de..8c3acb8a 100644 --- a/osmo-nitb-latest/Dockerfile +++ b/osmo-nitb-latest/Dockerfile @@ -2,6 +2,7 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/osmo-pcu-latest/Dockerfile b/osmo-pcu-latest/Dockerfile index 4714bf25..622f933f 100644 --- a/osmo-pcu-latest/Dockerfile +++ b/osmo-pcu-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-pcu && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-pcu && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-pcu \ + ;; \ + esac ADD respawn.sh /usr/local/bin/respawn.sh diff --git a/osmo-sgsn-latest/Dockerfile b/osmo-sgsn-latest/Dockerfile index c3b14109..21728c9d 100644 --- a/osmo-sgsn-latest/Dockerfile +++ b/osmo-sgsn-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-sgsn && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-sgsn && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-sgsn \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-sip-latest/Dockerfile b/osmo-sip-latest/Dockerfile index 79dbf550..825735c4 100644 --- a/osmo-sip-latest/Dockerfile +++ b/osmo-sip-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-sip-connector && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-sip-connector && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-sip-connector \ + ;; \ + esac WORKDIR /tmp diff --git a/osmo-smlc-latest/Dockerfile b/osmo-smlc-latest/Dockerfile index 51e290ab..12487ec7 100644 --- a/osmo-smlc-latest/Dockerfile +++ b/osmo-smlc-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-smlc && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-smlc && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-smlc \ + ;; \ + esac WORKDIR /data diff --git a/osmo-stp-latest/Dockerfile b/osmo-stp-latest/Dockerfile index c139af49..d3279f03 100644 --- a/osmo-stp-latest/Dockerfile +++ b/osmo-stp-latest/Dockerfile @@ -2,11 +2,20 @@ ARG USER ARG DISTRO FROM $USER/$DISTRO-obs-latest # Arguments used after FROM must be specified again +ARG DISTRO -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - osmo-stp && \ - apt-get clean +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-stp && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-stp \ + ;; \ + esac WORKDIR /data