@@ -286,43 +286,54 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
286
286
agent.sh
287
287
288
288
289
- # ############################################ Base image for Debian with NGINX Plus #############################################
290
- FROM debian:12-slim@sha256:1209d8fd77def86ceb6663deef7956481cc6c14a25e1e64daec12c0ceffcc19d AS debian-plus
289
+ # ############################################ Base image for Debian with NGINX Plus only #############################################
290
+ FROM debian:12-slim@sha256:1209d8fd77def86ceb6663deef7956481cc6c14a25e1e64daec12c0ceffcc19d AS debian-plus-only
291
291
ARG NGINX_PLUS_VERSION
292
292
293
293
ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
294
294
295
295
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
296
296
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
297
297
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
298
- --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
299
298
--mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_signing.key \
300
- --mount=type=bind,from=nginx-files,src=app-protect-security-updates.key,target=/tmp/app-protect-security-updates.key \
301
299
--mount=type=bind,from=nginx-files,src=90pkgs-nginx,target=/etc/apt/apt.conf.d/90pkgs-nginx \
302
300
--mount=type=bind,from=nginx-files,src=debian-plus-12.sources,target=/tmp/nginx-plus.sources \
303
- --mount=type=bind,from=nginx-files,src=debian-agentv3-12.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
304
- --mount=type=bind,from=nginx-files,src=agent.sh,target=/usr/local/bin/agent.sh \
305
301
--mount=type=bind,from=nginx-files,src=tracking.info,target=/tmp/nginx/reporting/tracking.info \
306
302
apt-get update \
307
303
&& apt-get install --no-install-recommends --no-install-suggests -y gpg ca-certificates libcap2-bin libcurl4 \
308
304
&& groupadd --system --gid 101 nginx \
309
305
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
310
306
&& gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg /tmp/nginx_signing.key \
311
- && gpg --dearmor -o /usr/share/keyrings/app-protect-archive-keyring.gpg /tmp/app-protect-security-updates.key \
312
307
&& cp /tmp/nginx-plus.sources /etc/apt/sources.list.d/nginx-plus.sources \
313
308
&& apt-get update \
314
- && apt-get install --no-install-recommends --no-install-suggests -y nginx-plus nginx-plus-module-njs nginx-plus-module-opentracing nginx-plus-module-fips-check nginx-agent \
309
+ && apt-get install --no-install-recommends --no-install-suggests -y nginx-plus nginx-plus-module-njs nginx-plus-module-opentracing nginx-plus-module-fips-check \
315
310
&& apt-get purge --auto-remove -y gpg \
316
- && cp -av /tmp/ot/usr/local/lib/libjaegertracing*so* /tmp/ot/usr/local/lib/libzipkin*so* /tmp/ot/usr/local/lib/libdd*so* /tmp/ot/usr/local/lib/libyaml*so* /usr/local/lib/ \
317
311
&& mkdir -p /etc/nginx/reporting/ \
318
312
&& cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \
319
- && ldconfig \
320
- && agent.sh \
321
313
&& rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx-plus.sources
322
314
323
315
316
+ # ############################################ Base image for Debian with NGINX Plus #############################################
317
+ FROM debian-plus-only AS debian-plus
318
+ ARG NGINX_PLUS_VERSION
319
+
320
+ ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
321
+
322
+ SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
323
+ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
324
+ --mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
325
+ --mount=type=bind,from=nginx-files,src=90pkgs-nginx,target=/etc/apt/apt.conf.d/90pkgs-nginx \
326
+ --mount=type=bind,from=nginx-files,src=debian-agentv3-12.sources,target=/tmp/nginx-agent.sources \
327
+ --mount=type=bind,from=nginx-files,src=agent.sh,target=/usr/local/bin/agent.sh \
328
+ apt-get update \
329
+ && cp /tmp/nginx-agent.sources /etc/apt/sources.list.d/nginx-agent.sources \
330
+ && apt-get update \
331
+ && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent \
332
+ && agent.sh \
333
+ && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx-agent.sources
334
+
324
335
# ############################################ Base image for Debian with NGINX Plus and App Protect WAF/DoS #############################################
325
- FROM debian-plus AS debian-plus-nap
336
+ FROM debian-plus-only AS debian-plus-nap
326
337
ARG NAP_MODULES
327
338
ARG NGINX_PLUS_VERSION
328
339
@@ -332,42 +343,39 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
332
343
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
333
344
--mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
334
345
--mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_signing.key \
346
+ --mount=type=bind,from=nginx-files,src=app-protect-security-updates.key,target=/tmp/app-protect-security-updates.key \
335
347
--mount=type=bind,from=nginx-files,src=90pkgs-nginx,target=/etc/apt/apt.conf.d/90pkgs-nginx \
336
348
--mount=type=bind,from=nginx-files,src=nap-waf-12.sources,target=/tmp/app-protect.sources \
337
349
--mount=type=bind,from=nginx-files,src=nap-dos-12.sources,target=/tmp/app-protect-dos.sources \
338
- --mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/etc/apt/sources.list.d /nginx-agent.sources \
350
+ --mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/tmp /nginx-agent.sources \
339
351
--mount=type=bind,from=nginx-files,src=agent.sh,target=/usr/local/bin/agent.sh \
340
352
--mount=type=bind,from=nginx-files,src=nap-waf.sh,target=/usr/local/bin/nap-waf.sh \
341
353
--mount=type=bind,from=nginx-files,src=nap-dos.sh,target=/usr/local/bin/nap-dos.sh \
342
354
--mount=type=bind,from=nginx-files,src=tracking.info,target=/tmp/nginx/reporting/tracking.info \
343
355
mkdir -p /etc/nginx/reporting/ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \
344
356
&& if [ -z "${NAP_MODULES##*waf*}" ]; then \
345
- cp /tmp/app-protect.sources /etc/ apt/sources.list.d/app-protect.sources; \
346
- fi \
347
- && if [ -z "${NAP_MODULES##*dos*}" ]; then \
348
- cp /tmp/app-protect-dos .sources /etc/apt/sources.list.d/app-protect-dos .sources; \
349
- fi \
357
+ apt-get update \
358
+ && apt-get install --no-install-recommends --no-install-suggests -y gpg \
359
+ && gpg --dearmor -o /usr/share/keyrings/app-protect-archive-keyring.gpg /tmp/app-protect-security-updates.key \
360
+ && cp /tmp/app-protect.sources /etc/apt/sources.list.d/app-protect.sources \
361
+ && cp /tmp/nginx-agent.sources /etc/apt/sources.list.d/nginx-agent.sources \
350
362
&& apt-get update \
351
- && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent \
352
- && if [ -z "${NAP_MODULES##*waf*}" ]; then \
353
- apt-get install --no-install-recommends --no-install-suggests -y app-protect app-protect-attack-signatures app-protect-threat-campaigns; \
354
- fi \
355
- && if [ -z "${NAP_MODULES##*dos*}" ]; then \
356
- apt-get install --no-install-recommends --no-install-suggests -y app-protect-dos; \
357
- fi \
358
- && if [ -z "${NAP_MODULES##*waf*}" ]; then \
359
- rm -f /etc/apt/sources.list.d/app-protect.sources; \
363
+ && apt-get install --no-install-recommends --no-install-suggests -y app-protect app-protect-attack-signatures app-protect-threat-campaigns nginx-agent \
364
+ && rm -f /etc/apt/sources.list.d/app-protect.sources /etc/apt/sources.list.d/nginx-agent.sources \
365
+ && nap-waf.sh \
366
+ && agent.sh; \
360
367
fi \
361
368
&& if [ -z "${NAP_MODULES##*dos*}" ]; then \
362
- rm -f /etc/apt/sources.list.d/app-protect-dos.sources; \
369
+ cp /tmp/app-protect-dos.sources /etc/apt/sources.list.d/app-protect-dos.sources \
370
+ && apt-get update \
371
+ && apt-get install --no-install-recommends --no-install-suggests -y app-protect-dos \
372
+ && rm -f /etc/apt/sources.list.d/app-protect-dos.sources \
373
+ && nap-dos.sh; \
363
374
fi \
364
- && rm -rf /var/lib/apt/lists/* \
365
- && if [ -z "${NAP_MODULES##*waf*}" ]; then nap-waf.sh; fi \
366
- && agent.sh \
367
- && if [ -z "${NAP_MODULES##*dos*}" ]; then nap-dos.sh; fi
375
+ && rm -rf /var/lib/apt/lists/*
368
376
369
377
# ############################################ Base image for Debian with NGINX Plus and App Protect WAFv5 #############################################
370
- FROM debian-plus AS debian-plus-nap-v5
378
+ FROM debian-plus-only AS debian-plus-nap-v5
371
379
ARG NAP_MODULES
372
380
ARG NGINX_PLUS_VERSION
373
381
@@ -382,10 +390,10 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
382
390
--mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
383
391
--mount=type=bind,from=nginx-files,src=tracking.info,target=/tmp/nginx/reporting/tracking.info \
384
392
mkdir -p /etc/nginx/reporting/ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \
385
- apt-get update \
386
- apt-get install --no-install-recommends --no-install-suggests -y \
387
- nginx-agent app-protect-module-plus=33+5.264* nginx-plus-module-appprotect=33+5.264*; \
388
- nap-waf.sh \
393
+ && apt-get update \
394
+ && apt-get install --no-install-recommends --no-install-suggests -y gpg \
395
+ nginx-agent app-protect-module-plus=33+5.264* nginx-plus-module-appprotect=33+5.264* app-protect-plugin=6.9.0* \
396
+ && nap-waf.sh \
389
397
&& apt-get purge --auto-remove -y gpg \
390
398
&& agent.sh
391
399
0 commit comments