@@ -380,6 +380,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
380380FROM ubi-9-plus AS ubi-9-plus-nap
381381ARG NAP_MODULES
382382ARG NGINX_AGENT
383+ ARG BUILD_OS
383384
384385RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
385386 --mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
@@ -399,7 +400,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
399400 && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
400401 && microdnf --nodocs install -y ca-certificates shadow-utils subscription-manager \
401402 && if [ "${NGINX_AGENT}" = "true" ]; then microdnf --nodocs install -y nginx-agent-2.*; fi \
402- && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
403+ && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} --name ${BUILD_OS}-${NAP_MODULES}-$(uname -m) || true \
403404 && subscription-manager attach \
404405 && rpm --import /tmp/app-protect-security-updates.key \
405406 && if [ -z "${NAP_MODULES##*waf*}" ]; then \
@@ -455,6 +456,7 @@ FROM redhat/ubi8@sha256:244e9858f9d8a2792a3dceb850b4fa8fdbd67babebfde42587bfa919
455456ARG NAP_MODULES
456457ARG NGINX_AGENT
457458ARG NGINX_PLUS_VERSION
459+ ARG BUILD_OS
458460
459461ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
460462
@@ -482,7 +484,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
482484 && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check \
483485 && if [ "${NGINX_AGENT}" = "true" ]; then dnf --nodocs install -y nginx-agent-2.*; fi \
484486 && sed -i 's/\( def in_container():\) /\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py \
485- && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
487+ && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} --name ${BUILD_OS}-$(uname -m) || true \
486488 && subscription-manager attach \
487489 && dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \
488490 && dnf --nodocs install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
@@ -504,6 +506,7 @@ FROM redhat/ubi8@sha256:244e9858f9d8a2792a3dceb850b4fa8fdbd67babebfde42587bfa919
504506ARG NAP_MODULES
505507ARG NGINX_AGENT
506508ARG NGINX_PLUS_VERSION
509+ ARG BUILD_OS
507510
508511ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
509512
@@ -532,7 +535,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
532535 && if [ "${NGINX_AGENT}" = "true" ]; then dnf --nodocs install -y nginx-agent-2.*; fi \
533536 # # end of duplicated code
534537 && sed -i 's/\( def in_container():\) /\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py \
535- && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
538+ && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} --name ${BUILD_OS}-$(uname -m) || true \
536539 && subscription-manager attach \
537540 && dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \
538541 && dnf --nodocs install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
0 commit comments