From 52338b78d0df1f1bb7492fc20b63a4fca9cfba78 Mon Sep 17 00:00:00 2001 From: Paul Abel <128620221+pdabelf5@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:14:51 +0000 Subject: [PATCH] build UBI s390x nginx package for OSS images (#6846) --- .github/workflows/build-ubi-dependency.yml | 6 +++--- .github/workflows/update-docker-sha.yml | 2 +- build/Dockerfile | 18 +++++++++--------- .../{Dockerfile.ubi-ppc64le => Dockerfile.ubi} | 3 ++- 4 files changed, 15 insertions(+), 14 deletions(-) rename build/dependencies/{Dockerfile.ubi-ppc64le => Dockerfile.ubi} (94%) diff --git a/.github/workflows/build-ubi-dependency.yml b/.github/workflows/build-ubi-dependency.yml index 53106a7af9..d335af7063 100644 --- a/.github/workflows/build-ubi-dependency.yml +++ b/.github/workflows/build-ubi-dependency.yml @@ -5,7 +5,7 @@ on: branches: - main paths: - - build/dependencies/Dockerfile.ubi-ppc64le + - build/dependencies/Dockerfile.ubi workflow_dispatch: inputs: nginx_version: @@ -58,7 +58,7 @@ jobs: if [ -n "${{ inputs.nginx_version }}" ]; then nginx_v=${{ inputs.nginx_version }} else - nginx_v=$(grep -m1 'FROM nginx:' /etc/yum.repos.d/nginx.repo \ - && microdnf --nodocs install -y nginx nginx-module-njs nginx-module-image-filter nginx-module-xslt \ - && rm /etc/yum.repos.d/nginx.repo; \ - else \ + if [ $(uname -p) = ppc64le ] || [ $(uname -p) = s390x ]; then \ rpm -qa --queryformat "%{NAME}\n" | sort > pkgs-installed \ && microdnf --nodocs --setopt=install_weak_deps=0 install -y diffutils dnf \ && rpm -qa --queryformat "%{NAME}\n" | sort > pkgs-new \ @@ -346,6 +340,12 @@ RUN --mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_s && dnf -q repoquery --resolve --requires --recursive --whatrequires nginx --queryformat "%{NAME}" > pkgs-nginx \ && dnf --setopt=protected_packages= remove -y $(comm -13 pkgs-installed pkgs-new | comm -13 pkgs-nginx -) \ && rm pkgs-installed pkgs-new pkgs-nginx; \ + else \ + printf "%s\n" "[nginx]" "name=nginx repo" \ + "baseurl=https://nginx.org/packages/mainline/centos/9/\$basearch/" \ + "gpgcheck=1" "enabled=1" "module_hotfixes=true" > /etc/yum.repos.d/nginx.repo \ + && microdnf --nodocs install -y nginx nginx-module-njs nginx-module-image-filter nginx-module-xslt \ + && rm /etc/yum.repos.d/nginx.repo; \ fi \ && ubi-clean.sh diff --git a/build/dependencies/Dockerfile.ubi-ppc64le b/build/dependencies/Dockerfile.ubi similarity index 94% rename from build/dependencies/Dockerfile.ubi-ppc64le rename to build/dependencies/Dockerfile.ubi index 1cec0d7481..22f13c2139 100644 --- a/build/dependencies/Dockerfile.ubi-ppc64le +++ b/build/dependencies/Dockerfile.ubi @@ -10,7 +10,8 @@ ENV NJS_VERSION ${NJS} RUN mkdir -p /nginx/; \ # only build for ppc64le but make multiarch image for mounting - [ $(uname -p) != ppc64le ] && exit 0; \ + [ $(uname -p) = x86_64 ] && exit 0; \ + [ $(uname -p) = aarch64 ] && exit 0; \ rpm --import https://nginx.org/keys/nginx_signing.key \ && MINOR_VERSION=$(echo ${NGINX_VERSION} | cut -d '.' -f 2) \ && if [ $(( $MINOR_VERSION % 2)) -eq 0 ]; then echo mainline=""; else mainline="mainline/"; fi \