@@ -3,6 +3,7 @@ ARG BUILD_OS=debian
3
3
ARG NGINX_OSS_VERSION=1.29
4
4
ARG NGINX_PLUS_VERSION=R35
5
5
ARG NGINX_AGENT_VERSION=3.3
6
+ ARG NAP_AGENT_VERSION=2.*
6
7
ARG DOWNLOAD_TAG=edge
7
8
ARG DEBIAN_FRONTEND=noninteractive
8
9
ARG PREBUILT_BASE_IMG=nginx/nginx-ingress:${DOWNLOAD_TAG}
@@ -208,6 +209,7 @@ RUN --mount=type=bind,from=alpine-fips-3.22,target=/tmp/fips/ \
208
209
FROM alpine:3.19@sha256:3be987e6cde1d07e873c012bf6cfe941e6e85d16ca5fc5b8bedc675451d2de67 AS alpine-plus-nap-fips
209
210
ARG NGINX_PLUS_VERSION
210
211
ARG PACKAGE_REPO
212
+ ARG NAP_AGENT_VERSION
211
213
212
214
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
213
215
@@ -224,7 +226,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
224
226
&& printf "%s\n " "https://pkgs.nginx.com/app-protect-security-updates/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
225
227
&& printf "%s\n " "https://${PACKAGE_REPO}/nginx-agent/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
226
228
&& apk add --no-cache libcap-utils libcurl nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check \
227
- && apk add --no-cache nginx-agent~2 \
229
+ && apk add --no-cache nginx-agent~${NAP_AGENT_VERSION%.*} \
228
230
&& mkdir -p /usr/ssl \
229
231
&& cp -av /tmp/fips/usr/lib/ossl-modules/fips.so /usr/lib/ossl-modules/fips.so \
230
232
&& cp -av /tmp/fips/usr/ssl/fipsmodule.cnf /usr/ssl/fipsmodule.cnf \
@@ -241,6 +243,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
241
243
FROM alpine:3.19@sha256:3be987e6cde1d07e873c012bf6cfe941e6e85d16ca5fc5b8bedc675451d2de67 AS alpine-plus-nap-v5-fips
242
244
ARG NGINX_PLUS_VERSION
243
245
ARG PACKAGE_REPO
246
+ ARG NAP_AGENT_VERSION
244
247
245
248
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
246
249
@@ -255,7 +258,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
255
258
&& printf "%s\n " "https://${PACKAGE_REPO}/app-protect-x-plus/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
256
259
&& printf "%s\n " "https://${PACKAGE_REPO}/nginx-agent/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
257
260
&& apk add --no-cache libcap-utils libcurl nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check \
258
- && apk add --no-cache nginx-agent~2 \
261
+ && apk add --no-cache nginx-agent~${NAP_AGENT_VERSION%.*} \
259
262
&& mkdir -p /usr/ssl \
260
263
&& cp -av /tmp/fips/usr/lib/ossl-modules/fips.so /usr/lib/ossl-modules/fips.so \
261
264
&& cp -av /tmp/fips/usr/ssl/fipsmodule.cnf /usr/ssl/fipsmodule.cnf \
@@ -321,6 +324,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
321
324
FROM debian-plus-only AS debian-plus-nap
322
325
ARG NAP_MODULES
323
326
ARG NGINX_PLUS_VERSION
327
+ ARG NAP_AGENT_VERSION
324
328
325
329
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
326
330
@@ -337,7 +341,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
337
341
cp /tmp/app-protect.sources /etc/apt/sources.list.d/app-protect.sources \
338
342
&& cp /tmp/nginx-agent.sources /etc/apt/sources.list.d/nginx-agent.sources \
339
343
&& apt-get update \
340
- && apt-get install --no-install-recommends --no-install-suggests -y app-protect app-protect-attack-signatures app-protect-threat-campaigns nginx-agent=2. * \
344
+ && apt-get install --no-install-recommends --no-install-suggests -y app-protect app-protect-attack-signatures app-protect-threat-campaigns nginx-agent=${NAP_AGENT_VERSION} * \
341
345
&& rm -f /etc/apt/sources.list.d/app-protect.sources /etc/apt/sources.list.d/nginx-agent.sources \
342
346
&& nap-waf.sh \
343
347
&& agent.sh; \
@@ -354,6 +358,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
354
358
# ############################################ Base image for Debian with NGINX Plus and App Protect WAFv5 #############################################
355
359
FROM debian-plus-only AS debian-plus-nap-v5
356
360
ARG NGINX_PLUS_VERSION
361
+ ARG NAP_AGENT_VERSION
357
362
358
363
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
359
364
@@ -365,7 +370,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
365
370
--mount=type=bind,from=nginx-files,src=nap-waf.sh,target=/usr/local/bin/nap-waf.sh \
366
371
--mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
367
372
apt-get update \
368
- && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent=2. * app-protect-module-plus=35+5.498* nginx-plus-module-appprotect=35+5.498* app-protect-plugin=6.20.0* \
373
+ && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent=${NAP_AGENT_VERSION} * app-protect-module-plus=35+5.498* nginx-plus-module-appprotect=35+5.498* app-protect-plugin=6.20.0* \
369
374
&& nap-waf.sh \
370
375
&& agent.sh
371
376
@@ -400,6 +405,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
400
405
FROM ubi-minimal AS ubi-9-plus-nap
401
406
ARG NAP_MODULES
402
407
ARG BUILD_OS
408
+ ARG NAP_AGENT_VERSION
403
409
404
410
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
405
411
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
@@ -420,7 +426,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
420
426
mkdir -p /etc/nginx/reporting/ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \
421
427
&& ubi-setup.sh \
422
428
&& rpm -Uvh /ubi-bin/c-ares-*.rpm \
423
- && microdnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-fips-check nginx-plus-module-otel nginx-agent-2. * \
429
+ && microdnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-fips-check nginx-plus-module-otel nginx-agent-${NAP_AGENT_VERSION} * \
424
430
&& source /tmp/rhel_license \
425
431
&& microdnf --nodocs install -y ca-certificates shadow-utils subscription-manager \
426
432
&& rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
@@ -447,6 +453,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
447
453
448
454
# ############################################ Base image for UBI with NGINX Plus and App Protect WAFv5 #############################################
449
455
FROM ubi-minimal AS ubi-9-plus-nap-v5
456
+ ARG NAP_AGENT_VERSION
450
457
451
458
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
452
459
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
@@ -468,7 +475,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
468
475
&& rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
469
476
&& rpm -Uvh /ubi-bin/c-ares-*.rpm \
470
477
&& microdnf --nodocs install -y ca-certificates shadow-utils subscription-manager \
471
- && microdnf --nodocs install -y nginx-plus-module-otel nginx-agent-2. * app-protect-module-plus-35+5.498* \
478
+ && microdnf --nodocs install -y nginx-plus-module-otel nginx-agent-${NAP_AGENT_VERSION} * app-protect-module-plus-35+5.498* \
472
479
&& nap-waf.sh \
473
480
&& ubi-clean.sh \
474
481
&& agent.sh
@@ -478,6 +485,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
478
485
FROM redhat/ubi8@sha256:534c2c0efa4150ede18e3f9d7480d3b9ec2a52e62bc91cd54e08ee7336819619 AS ubi-8-plus-nap
479
486
ARG NGINX_PLUS_VERSION
480
487
ARG BUILD_OS
488
+ ARG NAP_AGENT_VERSION
481
489
482
490
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
483
491
@@ -500,7 +508,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
500
508
&& rpm --import /tmp/nginx_signing.key \
501
509
&& rpm --import /tmp/app-protect-security-updates.key \
502
510
&& rpm -Uvh /ubi-bin/c-ares-*.rpm \
503
- && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-2. * \
511
+ && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-${NAP_AGENT_VERSION} * \
504
512
&& sed -i 's/\( def in_container():\) /\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py \
505
513
&& subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} --name ${BUILD_OS}-$(uname -m) || true \
506
514
&& subscription-manager attach \
@@ -516,6 +524,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
516
524
# ############################################ Base image for UBI8 with NGINX Plus and App Protect WAFv5 #############################################
517
525
FROM redhat/ubi8@sha256:534c2c0efa4150ede18e3f9d7480d3b9ec2a52e62bc91cd54e08ee7336819619 AS ubi-8-plus-nap-v5
518
526
ARG NGINX_PLUS_VERSION
527
+ ARG NAP_AGENT_VERSION
519
528
520
529
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
521
530
@@ -537,7 +546,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
537
546
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
538
547
&& rpm --import /tmp/nginx_signing.key \
539
548
&& rpm -Uvh /ubi-bin/c-ares-*.rpm \
540
- && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-2. * \
549
+ && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-${NAP_AGENT_VERSION} * \
541
550
&& dnf --nodocs install -y app-protect-module-plus-35+5.498* \
542
551
&& nap-waf.sh \
543
552
&& agent.sh \
0 commit comments