Skip to content

Commit 2079f1f

Browse files
committed
add rhel license to build
1 parent 3cf6990 commit 2079f1f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/build-ubi-dependency.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@ jobs:
138138
build-args: |
139139
NGINX=${{ needs.checks.outputs.nginx_version }}
140140
NJS=${{ needs.checks.outputs.njs_version }}
141+
secrets: |
142+
${{ format('"rhel_license={0}"', secrets.RHEL_LICENSE) }}

build/dependencies/Dockerfile.ubi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ FROM nginx:1.27.4@sha256:91734281c0ebfc6f1aea979cffeed5079cfe786228a71cc6f1f46a2
44
FROM redhat/ubi9:9.5@sha256:be214e191bbe3f4d0f16a5a4f5642e1f32fccd6fae7d2b6c6acb066ba51fb507 AS rpm-build
55
ARG NGINX
66
ARG NJS
7-
ENV NGINX_VERSION ${NGINX}
8-
ENV NJS_VERSION ${NJS}
9-
10-
11-
RUN mkdir -p /nginx/; \
7+
ENV NGINX_VERSION=${NGINX}
8+
ENV NJS_VERSION=${NJS}
9+
RUN --mount=type=secret,id=rhel_license,dst=/tmp/rhel_license,mode=0644 source /tmp/rhel_license; \
1210
# only build for ppc64le but make multiarch image for mounting
1311
[ $(uname -p) = x86_64 ] && exit 0; \
1412
[ $(uname -p) = aarch64 ] && exit 0; \
15-
rpm --import https://nginx.org/keys/nginx_signing.key \
13+
mkdir -p /nginx/ \
14+
&& rpm --import https://nginx.org/keys/nginx_signing.key \
1615
&& MINOR_VERSION=$(echo ${NGINX_VERSION} | cut -d '.' -f 2) \
1716
&& if [ $(( $MINOR_VERSION % 2)) -eq 0 ]; then echo mainline=""; else mainline="mainline/"; fi \
1817
&& printf "%s\n" "[nginx]" "name=nginx src repo" \
@@ -26,6 +25,7 @@ RUN mkdir -p /nginx/; \
2625
nginx-module-image-filter-${NGINX_VERSION} \
2726
nginx-module-njs-${NGINX_VERSION}+${NJS_VERSION} \
2827
" \
28+
&& dnf config-manager --set-enabled ubi-9-codeready-builder \
2929
&& dnf download --source ${nginxPackages} \
3030
&& dnf builddep -y --srpm nginx*.rpm \
3131
&& rpmbuild --rebuild --nodebuginfo nginx*.rpm \

0 commit comments

Comments
 (0)