From cc5543b4dac47ccdbda9b7b1abb6f4592d8a2f93 Mon Sep 17 00:00:00 2001 From: "Aleksandar N. Kostadinov" Date: Thu, 25 Apr 2024 00:35:36 +0300 Subject: [PATCH 1/6] support fetching a non-tagged commit --- Containerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index 8d19490..19cd35a 100644 --- a/Containerfile +++ b/Containerfile @@ -1,4 +1,5 @@ FROM quay.io/centos/centos:stream9 AS builder + ENV SEARCHD_REF=6.3.6 \ SEARCHD_REPO=https://github.com/manticoresoftware/manticoresearch.git \ CC=clang \ @@ -12,7 +13,10 @@ SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] # also replace llvm-toolset with make automake gcc gcc-c++ kernel-devel # hadolint ignore=DL3003,DL3032,SC2046 RUN yum install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs llvm-toolset mysql cmake boost-devel openssl-devel zlib-devel libicu-devel bison flex systemd-units rpm-build git && \ - git clone --depth=1 --branch=$SEARCHD_REF $SEARCHD_REPO . && \ + git init . && \ + git remote add origin $SEARCHD_REPO && \ + git fetch --depth=1 origin $SEARCHD_REF && \ + git reset --hard FETCH_HEAD && \ # boost lib in RHEL9 comes dynamic only so enable its use \ sed -i -e 's/Boost_USE_STATIC_LIBS ON/Boost_USE_STATIC_LIBS OFF/' src/CMakeLists.txt && \ mkdir build && cd build && \ From 805e9873b944179276cacb562caf06c88247b55f Mon Sep 17 00:00:00 2001 From: "Aleksandar N. Kostadinov" Date: Sat, 16 Nov 2024 22:10:08 +0200 Subject: [PATCH 2/6] upgrade to manticore 6.3.8 --- Containerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index 19cd35a..bfb8bda 100644 --- a/Containerfile +++ b/Containerfile @@ -1,6 +1,7 @@ FROM quay.io/centos/centos:stream9 AS builder -ENV SEARCHD_REF=6.3.6 \ +# this is 6.3.8 + big endian fixes and a few other patches +ENV SEARCHD_REF=de6e35e2e233a012c5a7ed60675d15620234fad3 \ SEARCHD_REPO=https://github.com/manticoresoftware/manticoresearch.git \ CC=clang \ CXX=clang++ \ From e2e985b9e47b975c1d5d1cce913f3f1797b56452 Mon Sep 17 00:00:00 2001 From: "Aleksandar N. Kostadinov" Date: Mon, 16 Dec 2024 14:47:43 +0200 Subject: [PATCH 3/6] fix compiling Manticore 6.3.8 fixes THREESCALE-11457 --- Containerfile | 37 +++++++++++++++++++------- centos_repo/RPM-GPG-KEY-centosofficial | 30 +++++++++++++++++++++ centos_repo/centos-appstream.repo | 9 +++++++ centos_repo/vars/stream | 1 + 4 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 centos_repo/RPM-GPG-KEY-centosofficial create mode 100644 centos_repo/centos-appstream.repo create mode 100644 centos_repo/vars/stream diff --git a/Containerfile b/Containerfile index bfb8bda..36613e6 100644 --- a/Containerfile +++ b/Containerfile @@ -3,18 +3,36 @@ FROM quay.io/centos/centos:stream9 AS builder # this is 6.3.8 + big endian fixes and a few other patches ENV SEARCHD_REF=de6e35e2e233a012c5a7ed60675d15620234fad3 \ SEARCHD_REPO=https://github.com/manticoresoftware/manticoresearch.git \ - CC=clang \ - CXX=clang++ \ + # CC=clang-16 \ + # CXX=clang++-16 \ BUILD_PATH=/tmp/manticore_uselessly_very_long_path_to_prevent_rpm_build_issues \ - BUILD_FLAGS="-DUSE_SYSLOG=0 -DWITH_GALERA=0 -DWITH_RE2=0 -DWITH_STEMMER=0 -DWITH_ICU_FORCE_STATIC=0 -DWITH_SSL=1 -DWITH_ZLIB=1 -DWITH_ODBC=0 -DWITH_EXPAT=0 -DWITH_ICONV=1 -DWITH_POSTGRESQL=0 -DWITH_MYSQL=0 -DBUILD_TESTING=0 -DDISTR=rhel9" + BUILD_FLAGS="-DUSE_SYSLOG=0 -DWITH_GALERA=0 -DWITH_RE2=0 -DWITH_STEMMER=0 -DWITH_ICU_FORCE_STATIC=0 -DWITH_SSL=1 -DWITH_ZLIB=1 -DWITH_ODBC=0 -DWITH_EXPAT=0 -DWITH_ICONV=1 -DWITH_POSTGRESQL=0 -DWITH_MYSQL=0 -DBUILD_TESTING=0 -DDISTR=rhel9" \ + DEPS_CLANG_RHEL9="llvm-toolset-16.0.6-4.el9" \ + DEPS_GCC_UBI9="make automake gcc-toolset-13 gcc gcc-c++" \ + DEPS_NON_UBI="boost-devel bison flex" WORKDIR $BUILD_PATH SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] -# clang is broken on s390x (RHEL-15874), to use gcc remove CC and CXX variables, -# also replace llvm-toolset with make automake gcc gcc-c++ kernel-devel -# hadolint ignore=DL3003,DL3032,SC2046 -RUN yum install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs llvm-toolset mysql cmake boost-devel openssl-devel zlib-devel libicu-devel bison flex systemd-units rpm-build git && \ - git init . && \ +# to use clang, adjust CC and CXX variables and dependencies +# hadolint ignore=DL3040 +RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs mysql cmake $DEPS_GCC_UBI9 openssl-devel zlib-devel libicu-devel systemd-units rpm-build git xz gcc-c++ + +# install non-ubi deps form centos +COPY centos_repo/RPM-GPG-KEY-centosofficial /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +COPY centos_repo/centos-appstream.repo /etc/yum.repos.d/ +COPY centos_repo/vars/stream /etc/yum/vars/ +COPY centos_repo/vars/stream /etc/dnf/vars/ +# hadolint ignore=DL3040 +RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs $DEPS_NON_UBI + +# RUN curl -sSL https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/llvm-project-16.0.6.src.tar.xz -o llvm-project-16.0.6.src.tar.xz && \ +# tar xvfJ llvm-project-16.0.6.src.tar.xz && \ +# cd llvm-project-16.0.6.src && \ +# cmake -S llvm -B build -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_BUILD_TYPE=MinSizeRel && \ +# cmake --build build && \ +# cmake --install build + +RUN git init . && \ git remote add origin $SEARCHD_REPO && \ git fetch --depth=1 origin $SEARCHD_REF && \ git reset --hard FETCH_HEAD && \ @@ -62,5 +80,6 @@ RUN microdnf install -y --nodocs mysql openssl boost-context boost-filesystem zl chgrp 0 /var/lib/searchd /var/run/manticore /var/log/manticore WORKDIR /var/lib/manticore -ENTRYPOINT ["/bin/env", "searchd", "--pidfile", "--config", "/etc/manticoresearch/manticore.conf", "--nodetach"] +ENTRYPOINT ["/bin/searchd", "--pidfile", "--config", "/etc/manticoresearch/manticore.conf", "--nodetach"] +USER 1001 EXPOSE 9306/tcp diff --git a/centos_repo/RPM-GPG-KEY-centosofficial b/centos_repo/RPM-GPG-KEY-centosofficial new file mode 100644 index 0000000..30235a8 --- /dev/null +++ b/centos_repo/RPM-GPG-KEY-centosofficial @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQINBFzMWxkBEADHrskpBgN9OphmhRkc7P/YrsAGSvvl7kfu+e9KAaU6f5MeAVyn +rIoM43syyGkgFyWgjZM8/rur7EMPY2yt+2q/1ZfLVCRn9856JqTIq0XRpDUe4nKQ +8BlA7wDVZoSDxUZkSuTIyExbDf0cpw89Tcf62Mxmi8jh74vRlPy1PgjWL5494b3X +5fxDidH4bqPZyxTBqPrUFuo+EfUVEqiGF94Ppq6ZUvrBGOVo1V1+Ifm9CGEK597c +aevcGc1RFlgxIgN84UpuDjPR9/zSndwJ7XsXYvZ6HXcKGagRKsfYDWGPkA5cOL/e +f+yObOnC43yPUvpggQ4KaNJ6+SMTZOKikM8yciyBwLqwrjo8FlJgkv8Vfag/2UR7 +JINbyqHHoLUhQ2m6HXSwK4YjtwidF9EUkaBZWrrskYR3IRZLXlWqeOi/+ezYOW0m +vufrkcvsh+TKlVVnuwmEPjJ8mwUSpsLdfPJo1DHsd8FS03SCKPaXFdD7ePfEjiYk +nHpQaKE01aWVSLUiygn7F7rYemGqV9Vt7tBw5pz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-appstream.repo b/centos_repo/centos-appstream.repo new file mode 100644 index 0000000..45831ed --- /dev/null +++ b/centos_repo/centos-appstream.repo @@ -0,0 +1,9 @@ +[appstream] +name=CentOS Stream $releasever - AppStream +metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=1 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=1 diff --git a/centos_repo/vars/stream b/centos_repo/vars/stream new file mode 100644 index 0000000..0a472b5 --- /dev/null +++ b/centos_repo/vars/stream @@ -0,0 +1 @@ +9-stream From 2680228afe6db208925382660cb3622c1aa3bdf3 Mon Sep 17 00:00:00 2001 From: "Aleksandar N. Kostadinov" Date: Thu, 19 Dec 2024 22:30:35 +0200 Subject: [PATCH 4/6] use centos to build and ubi runtime --- Containerfile | 14 ++++-------- centos_repo/RPM-GPG-KEY-centosofficial | 30 -------------------------- centos_repo/centos-appstream.repo | 9 -------- centos_repo/vars/stream | 1 - 4 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 centos_repo/RPM-GPG-KEY-centosofficial delete mode 100644 centos_repo/centos-appstream.repo delete mode 100644 centos_repo/vars/stream diff --git a/Containerfile b/Containerfile index 36613e6..03554e4 100644 --- a/Containerfile +++ b/Containerfile @@ -15,15 +15,7 @@ WORKDIR $BUILD_PATH SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] # to use clang, adjust CC and CXX variables and dependencies # hadolint ignore=DL3040 -RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs mysql cmake $DEPS_GCC_UBI9 openssl-devel zlib-devel libicu-devel systemd-units rpm-build git xz gcc-c++ - -# install non-ubi deps form centos -COPY centos_repo/RPM-GPG-KEY-centosofficial /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -COPY centos_repo/centos-appstream.repo /etc/yum.repos.d/ -COPY centos_repo/vars/stream /etc/yum/vars/ -COPY centos_repo/vars/stream /etc/dnf/vars/ -# hadolint ignore=DL3040 -RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs $DEPS_NON_UBI +RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs mysql cmake $DEPS_GCC_UBI9 $DEPS_NON_UBI openssl-devel zlib-devel libicu-devel systemd-units rpm-build git xz gcc-c++ # RUN curl -sSL https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/llvm-project-16.0.6.src.tar.xz -o llvm-project-16.0.6.src.tar.xz && \ # tar xvfJ llvm-project-16.0.6.src.tar.xz && \ @@ -49,7 +41,9 @@ WORKDIR /var/adm USER adm RUN rpmbuild -bb rpmbuild/SPECS/manticore-tzdata.spec -FROM quay.io/centos/centos:stream9-minimal +# it is ok not to tag ubi image as it is stable enough +# hadolint ignore=DL3006 +FROM registry.access.redhat.com/ubi9-minimal LABEL org.opencontainers.image.authors="https://issues.redhat.com/browse/THREESCALE" \ org.opencontainers.image.title="3scale searchd" \ diff --git a/centos_repo/RPM-GPG-KEY-centosofficial b/centos_repo/RPM-GPG-KEY-centosofficial deleted file mode 100644 index 30235a8..0000000 --- a/centos_repo/RPM-GPG-KEY-centosofficial +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v2.0.22 (GNU/Linux) - -mQINBFzMWxkBEADHrskpBgN9OphmhRkc7P/YrsAGSvvl7kfu+e9KAaU6f5MeAVyn -rIoM43syyGkgFyWgjZM8/rur7EMPY2yt+2q/1ZfLVCRn9856JqTIq0XRpDUe4nKQ -8BlA7wDVZoSDxUZkSuTIyExbDf0cpw89Tcf62Mxmi8jh74vRlPy1PgjWL5494b3X -5fxDidH4bqPZyxTBqPrUFuo+EfUVEqiGF94Ppq6ZUvrBGOVo1V1+Ifm9CGEK597c -aevcGc1RFlgxIgN84UpuDjPR9/zSndwJ7XsXYvZ6HXcKGagRKsfYDWGPkA5cOL/e -f+yObOnC43yPUvpggQ4KaNJ6+SMTZ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NTjhx0e/QHEVcYAqNLhXG -rCTTbCn3NSUO9qxEXC+K/1m1kaXoCGA0UWlVGZ1JSifbbMx0yxq/brpEZPUYm+32 -o8XfbocBWljFUJ+6aljTvZ3LQLKTSPW7TFO+GXycAOmCGhlXh2tlc6iTc41PACqy -yy+mHmSv -=kkH7 ------END PGP PUBLIC KEY BLOCK----- diff --git a/centos_repo/centos-appstream.repo b/centos_repo/centos-appstream.repo deleted file mode 100644 index 45831ed..0000000 --- a/centos_repo/centos-appstream.repo +++ /dev/null @@ -1,9 +0,0 @@ -[appstream] -name=CentOS Stream $releasever - AppStream -metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=1 diff --git a/centos_repo/vars/stream b/centos_repo/vars/stream deleted file mode 100644 index 0a472b5..0000000 --- a/centos_repo/vars/stream +++ /dev/null @@ -1 +0,0 @@ -9-stream From db61f1eb685a51d90e1999c6f9dba153e21e6acd Mon Sep 17 00:00:00 2001 From: "Aleksandar N. Kostadinov" Date: Fri, 20 Dec 2024 17:19:05 +0200 Subject: [PATCH 5/6] install boost in ubi from centos --- Containerfile | 15 +++++++++++-- centos_repo/RPM-GPG-KEY-centosofficial | 30 ++++++++++++++++++++++++++ centos_repo/centos-appstream.repo | 9 ++++++++ centos_repo/vars/stream | 1 + 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 centos_repo/RPM-GPG-KEY-centosofficial create mode 100644 centos_repo/centos-appstream.repo create mode 100644 centos_repo/vars/stream diff --git a/Containerfile b/Containerfile index 03554e4..869b1a3 100644 --- a/Containerfile +++ b/Containerfile @@ -62,8 +62,19 @@ COPY --from=builder /tmp/manticore_uselessly_very_long_path_to_prevent_rpm_build COPY --from=builder /var/adm/rpmbuild/RPMS/noarch/manticore-tzdata-1.1-1.noarch.rpm /tmp/rpms/ COPY --from=$PORTA_IMAGE /opt/system/config/standalone.sphinx.conf "/etc/manticoresearch/manticore.conf" ENV MANTICORE_RPMS="manticore-converter* manticore-common* manticore-server-core* manticore-server* manticore-tzdata-1.1-1.noarch.rpm" -RUN microdnf install -y --nodocs mysql openssl boost-context boost-filesystem zlib libicu && \ - cd /tmp/rpms && ls -l && \ + +# hadolint ignore=DL3040 +RUN microdnf install -y --nodocs mysql openssl boost-context boost-filesystem zlib libicu + +# install boost from centos as it is missing in ubi +COPY centos_repo/RPM-GPG-KEY-centosofficial /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +COPY centos_repo/centos-appstream.repo /etc/yum.repos.d/ +COPY centos_repo/vars/stream /etc/yum/vars/ +COPY centos_repo/vars/stream /etc/dnf/vars/ +# hadolint ignore=DL3040 +RUN microdnf install -y --nodocs boost-context boost-filesystem + +RUN cd /tmp/rpms && ls -l && \ rpm -iv --excludedocs $MANTICORE_RPMS && \ cd - && rm -rf /tmp/rpms && \ microdnf clean all && \ diff --git a/centos_repo/RPM-GPG-KEY-centosofficial b/centos_repo/RPM-GPG-KEY-centosofficial new file mode 100644 index 0000000..30235a8 --- /dev/null +++ b/centos_repo/RPM-GPG-KEY-centosofficial @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQINBFzMWxkBEADHrskpBgN9OphmhRkc7P/YrsAGSvvl7kfu+e9KAaU6f5MeAVyn +rIoM43syyGkgFyWgjZM8/rur7EMPY2yt+2q/1ZfLVCRn9856JqTIq0XRpDUe4nKQ +8BlA7wDVZoSDxUZkSuTIyExbDf0cpw89Tcf62Mxmi8jh74vRlPy1PgjWL5494b3X +5fxDidH4bqPZyxTBqPrUFuo+EfUVEqiGF94Ppq6ZUvrBGOVo1V1+Ifm9CGEK597c +aevcGc1RFlgxIgN84UpuDjPR9/zSndwJ7XsXYvZ6HXcKGagRKsfYDWGPkA5cOL/e +f+yObOnC43yPUvpggQ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4koIjZGEAg04iuyNTjhx0e/QHEVcYAqNLhXG +rCTTbCn3NSUO9qxEXC+K/1m1kaXoCGA0UWlVGZ1JSifbbMx0yxq/brpEZPUYm+32 +o8XfbocBWljFUJ+6aljTvZ3LQLKTSPW7TFO+GXycAOmCGhlXh2tlc6iTc41PACqy +yy+mHmSv +=kkH7 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/centos_repo/centos-appstream.repo b/centos_repo/centos-appstream.repo new file mode 100644 index 0000000..45831ed --- /dev/null +++ b/centos_repo/centos-appstream.repo @@ -0,0 +1,9 @@ +[appstream] +name=CentOS Stream $releasever - AppStream +metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +gpgcheck=1 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=1 diff --git a/centos_repo/vars/stream b/centos_repo/vars/stream new file mode 100644 index 0000000..0a472b5 --- /dev/null +++ b/centos_repo/vars/stream @@ -0,0 +1 @@ +9-stream From 171b80c44cc64230dd014baf37008109a3cbeede Mon Sep 17 00:00:00 2001 From: "Aleksandar N. Kostadinov" Date: Fri, 20 Dec 2024 17:59:11 +0200 Subject: [PATCH 6/6] boost from centos in a better way --- Containerfile | 28 ++++++++++++------------ centos_repo/RPM-GPG-KEY-centosofficial | 30 -------------------------- centos_repo/centos-appstream.repo | 9 -------- centos_repo/vars/stream | 1 - 4 files changed, 14 insertions(+), 54 deletions(-) delete mode 100644 centos_repo/RPM-GPG-KEY-centosofficial delete mode 100644 centos_repo/centos-appstream.repo delete mode 100644 centos_repo/vars/stream diff --git a/Containerfile b/Containerfile index 869b1a3..80a04d7 100644 --- a/Containerfile +++ b/Containerfile @@ -9,15 +9,18 @@ ENV SEARCHD_REF=de6e35e2e233a012c5a7ed60675d15620234fad3 \ BUILD_FLAGS="-DUSE_SYSLOG=0 -DWITH_GALERA=0 -DWITH_RE2=0 -DWITH_STEMMER=0 -DWITH_ICU_FORCE_STATIC=0 -DWITH_SSL=1 -DWITH_ZLIB=1 -DWITH_ODBC=0 -DWITH_EXPAT=0 -DWITH_ICONV=1 -DWITH_POSTGRESQL=0 -DWITH_MYSQL=0 -DBUILD_TESTING=0 -DDISTR=rhel9" \ DEPS_CLANG_RHEL9="llvm-toolset-16.0.6-4.el9" \ DEPS_GCC_UBI9="make automake gcc-toolset-13 gcc gcc-c++" \ - DEPS_NON_UBI="boost-devel bison flex" + DEPS_NON_UBI="boost-devel bison flex" \ + DEPS_NON_UBI_RUNTIME="boost-context boost-filesystem boost-system" + WORKDIR $BUILD_PATH SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] # to use clang, adjust CC and CXX variables and dependencies # hadolint ignore=DL3040 -RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs mysql cmake $DEPS_GCC_UBI9 $DEPS_NON_UBI openssl-devel zlib-devel libicu-devel systemd-units rpm-build git xz gcc-c++ +RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs mysql cmake $DEPS_GCC_UBI9 $DEPS_NON_UBI openssl-devel zlib-devel libicu-devel systemd-units rpm-build git 'dnf-command(download)' -# RUN curl -sSL https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/llvm-project-16.0.6.src.tar.xz -o llvm-project-16.0.6.src.tar.xz && \ +# RUN dnf install -y --setopt=strict=True --setopt=tsflags=nodocs xz gcc-c++ +# curl -sSL https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/llvm-project-16.0.6.src.tar.xz -o llvm-project-16.0.6.src.tar.xz && \ # tar xvfJ llvm-project-16.0.6.src.tar.xz && \ # cd llvm-project-16.0.6.src && \ # cmake -S llvm -B build -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_BUILD_TYPE=MinSizeRel && \ @@ -41,6 +44,10 @@ WORKDIR /var/adm USER adm RUN rpmbuild -bb rpmbuild/SPECS/manticore-tzdata.spec +# Download boost RPMs for runtime +WORKDIR /tmp/boost_rpms +RUN dnf download --arch `uname -m` $DEPS_NON_UBI_RUNTIME + # it is ok not to tag ubi image as it is stable enough # hadolint ignore=DL3006 FROM registry.access.redhat.com/ubi9-minimal @@ -60,23 +67,16 @@ LABEL org.opencontainers.image.authors="https://issues.redhat.com/browse/THREESC ARG PORTA_IMAGE=quay.io/3scale/porta:nightly COPY --from=builder /tmp/manticore_uselessly_very_long_path_to_prevent_rpm_build_issues/build/*.rpm /tmp/rpms/ COPY --from=builder /var/adm/rpmbuild/RPMS/noarch/manticore-tzdata-1.1-1.noarch.rpm /tmp/rpms/ +COPY --from=builder /tmp/boost_rpms/ /tmp/boost_rpms/ COPY --from=$PORTA_IMAGE /opt/system/config/standalone.sphinx.conf "/etc/manticoresearch/manticore.conf" ENV MANTICORE_RPMS="manticore-converter* manticore-common* manticore-server-core* manticore-server* manticore-tzdata-1.1-1.noarch.rpm" # hadolint ignore=DL3040 -RUN microdnf install -y --nodocs mysql openssl boost-context boost-filesystem zlib libicu - -# install boost from centos as it is missing in ubi -COPY centos_repo/RPM-GPG-KEY-centosofficial /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -COPY centos_repo/centos-appstream.repo /etc/yum.repos.d/ -COPY centos_repo/vars/stream /etc/yum/vars/ -COPY centos_repo/vars/stream /etc/dnf/vars/ -# hadolint ignore=DL3040 -RUN microdnf install -y --nodocs boost-context boost-filesystem +RUN microdnf install -y --nodocs mysql openssl zlib libicu RUN cd /tmp/rpms && ls -l && \ - rpm -iv --excludedocs $MANTICORE_RPMS && \ - cd - && rm -rf /tmp/rpms && \ + rpm -iv --excludedocs /tmp/boost_rpms/* $MANTICORE_RPMS && \ + cd - && rm -rf /tmp/rpms /tmp/boost_rpms && \ microdnf clean all && \ # TODO: once in production, update porta to generate config with the correct path \ sed -i -e 's#/var/run/sphinx/#/var/run/manticore/#' /etc/manticoresearch/manticore.conf && \ diff --git a/centos_repo/RPM-GPG-KEY-centosofficial b/centos_repo/RPM-GPG-KEY-centosofficial deleted file mode 100644 index 30235a8..0000000 --- a/centos_repo/RPM-GPG-KEY-centosofficial +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v2.0.22 (GNU/Linux) - -mQINBFzMWxkBEADHrskpBgN9OphmhRkc7P/YrsAGSvvl7kfu+e9KAaU6f5MeAVyn -rIoM43syyGkgFyWgjZM8/rur7EMPY2yt+2q/1ZfLVCRn9856JqTIq0XRpDUe4nKQ -8BlA7wDVZoSDxUZkSuTIyExbDf0cpw89Tcf62Mxmi8jh74vRlPy1PgjWL5494b3X -5fxDidH4bqPZyxTBqPrUFuo+EfUVEqiGF94Ppq6ZUvrBGOVo1V1+Ifm9CGEK597c -aevcGc1RFlgxIgN84UpuDjPR9/zSndwJ7XsXYvZ6HXcKGagRKsfYDWGPkA5cOL/e -f+yObOnC43yPUvpggQ4KaNJ6+SMTZOKikM8yciyBwLqwrjo8FlJgkv8Vfag/2UR7 -JINbyqHHoLUhQ2m6HXSwK4YjtwidF9EUkaBZWrrskYR3IRZLXlWqeOi/+ezYOW0m -vufrkcvsh+TKlVVnuwmEPjJ8mwUSpsLdfPJo1DHsd8FS03SCKPaXFdD7ePfEjiYk -nHpQaKE01aWVSLUiygn7F7rYemGqV9Vt7tBw5pz0vqSC72a5E3zFzIIuHx6aANry -Gat3aqU3qtBXOrA/dPkX9cWE+UR5wo/A2UdKJZLlGhM2WRJ3ltmGT48V9CeS6N9Y -m4CKdzvg7EWjlTlFrd/8WJ2KoqOE9leDPeXRPncubJfJ6LLIHyG09h9kKQARAQAB -tDpDZW50T1MgKENlbnRPUyBPZmZpY2lhbCBTaWduaW5nIEtleSkgPHNlY3VyaXR5 -QGNlbnRvcy5vcmc+iQI3BBMBAgAhBQJczFsZAhsDBgsJCAcDAgYVCAIJCgsDFgIB -Ah4BAheAAAoJEAW1VbOEg8ZdjOsP/2ygSxH9jqffOU9SKyJDlraL2gIutqZ3B8pl -Gy/Qnb9QD1EJVb4ZxOEhcY2W9VJfIpnf3yBuAto7zvKe/G1nxH4Bt6WTJQCkUjcs -N3qPWsx1VslsAEz7bXGiHym6Ay4xF28bQ9XYIokIQXd0T2rD3/lNGxNtORZ2bKjD -vOzYzvh2idUIY1DgGWJ11gtHFIA9CvHcW+SMPEhkcKZJAO51ayFBqTSSpiorVwTq -a0cB+cgmCQOI4/MY+kIvzoexfG7xhkUqe0wxmph9RQQxlTbNQDCdaxSgwbF2T+gw -byaDvkS4xtR6Soj7BKjKAmcnf5fn4C5Or0KLUqMzBtDMbfQQihn62iZJN6ZZ/4dg -q4HTqyVpyuzMXsFpJ9L/FqH2DJ4exGGpBv00ba/Zauy7GsqOc5PnNBsYaHCply0X -407DRx51t9YwYI/ttValuehq9+gRJpOTTKp6AjZn/a5Yt3h6jDgpNfM/EyLFIY9z -V6CXqQQ/8JRvaik/JsGCf+eeLZOw4koIjZGEAg04iuyNTjhx0e/QHEVcYAqNLhXG -rCTTbCn3NSUO9qxEXC+K/1m1kaXoCGA0UWlVGZ1JSifbbMx0yxq/brpEZPUYm+32 -o8XfbocBWljFUJ+6aljTvZ3LQLKTSPW7TFO+GXycAOmCGhlXh2tlc6iTc41PACqy -yy+mHmSv -=kkH7 ------END PGP PUBLIC KEY BLOCK----- diff --git a/centos_repo/centos-appstream.repo b/centos_repo/centos-appstream.repo deleted file mode 100644 index 45831ed..0000000 --- a/centos_repo/centos-appstream.repo +++ /dev/null @@ -1,9 +0,0 @@ -[appstream] -name=CentOS Stream $releasever - AppStream -metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -gpgcheck=1 -repo_gpgcheck=0 -metadata_expire=6h -countme=1 -enabled=1 diff --git a/centos_repo/vars/stream b/centos_repo/vars/stream deleted file mode 100644 index 0a472b5..0000000 --- a/centos_repo/vars/stream +++ /dev/null @@ -1 +0,0 @@ -9-stream