@@ -75,12 +75,11 @@ ADD --link --chown=101:0 https://cs.nginx.com/static/files/app-protect-9.repo ap
75
75
ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-waf-v5-ubi-8.repo app-protect-v5-8.repo
76
76
ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-waf-v5-ubi-9.repo app-protect-v5-9.repo
77
77
ADD --link --chown=101:0 https://cs.nginx.com/static/files/app-protect-dos-8.repo app-protect-dos-8.repo
78
- ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/plus-debian-11.repo debian-plus-11.sources
79
78
ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/plus-debian-12.repo debian-plus-12.sources
80
- ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-waf-debian-11 .repo nap-waf-11 .sources
81
- ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-dos-debian-11 .repo nap-dos-11 .sources
79
+ ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-waf-debian-12 .repo nap-waf-12 .sources
80
+ ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-dos-debian-12 .repo nap-dos-12 .sources
82
81
ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/nap-waf-v5-debian-12.repo nap-waf-v5-12.sources
83
- ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/agent-debian-11 .repo debian-agent-11 .sources
82
+ ADD --link --chown=101:0 https://raw.githubusercontent.com/nginxinc/k8s-common/main/files/agent-debian-12 .repo debian-agent-12 .sources
84
83
85
84
RUN --mount=from=busybox:musl,src=/bin/,dst=/bin/ printf "%s\n " "Acquire::https::pkgs.nginx.com::User-Agent k8s-ic-$IC_VERSION${BUILD_OS##debian-plus}-apt;" >> 90pkgs-nginx \
86
85
&& printf "%s\n " "user_agent=k8s-ic-$IC_VERSION${BUILD_OS##ubi*plus}-dnf" | tee -a nginx-plus-*.repo \
@@ -225,13 +224,15 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
225
224
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
226
225
--mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
227
226
--mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_signing.key \
227
+ --mount=type=bind,from=nginx-files,src=app-protect-security-updates.key,target=/tmp/app-protect-security-updates.key \
228
228
--mount=type=bind,from=nginx-files,src=90pkgs-nginx,target=/etc/apt/apt.conf.d/90pkgs-nginx \
229
229
--mount=type=bind,from=nginx-files,src=debian-plus-12.sources,target=/etc/apt/sources.list.d/nginx-plus.sources \
230
230
apt-get update \
231
231
&& apt-get install --no-install-recommends --no-install-suggests -y gpg ca-certificates libcap2-bin libcurl4 \
232
232
&& groupadd --system --gid 101 nginx \
233
233
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
234
234
&& gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg /tmp/nginx_signing.key \
235
+ && gpg --dearmor -o /usr/share/keyrings/app-protect-archive-keyring.gpg /tmp/app-protect-security-updates.key \
235
236
&& apt-get update \
236
237
&& 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 \
237
238
&& apt-get purge --auto-remove -y gpg \
@@ -241,7 +242,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
241
242
242
243
243
244
# ############################################ Base image for Debian with NGINX Plus and App Protect WAF/DoS #############################################
244
- FROM debian:11-slim@sha256:acc5810124f0929ab44fc7913c0ad936b074cbd3eadf094ac120190862ba36c4 as debian-plus-nap
245
+ FROM debian-plus as debian-plus-nap
245
246
ARG NAP_MODULES
246
247
ARG NGINX_AGENT
247
248
ARG NGINX_PLUS_VERSION
@@ -252,59 +253,37 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
252
253
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
253
254
--mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
254
255
--mount=type=bind,from=nginx-files,src=nginx_signing.key,target=/tmp/nginx_signing.key \
255
- --mount=type=bind,from=nginx-files,src=app-protect-security-updates.key,target=/tmp/app-protect-security-updates.key \
256
256
--mount=type=bind,from=nginx-files,src=90pkgs-nginx,target=/etc/apt/apt.conf.d/90pkgs-nginx \
257
- --mount=type=bind,from=nginx-files,src=debian-plus-11.sources,target=/etc/apt/sources.list.d/nginx-plus.sources \
258
- --mount=type=bind,from=nginx-files,src=nap-waf-11.sources,target=/tmp/app-protect.sources \
259
- --mount=type=bind,from=nginx-files,src=nap-dos-11.sources,target=/tmp/app-protect-dos.sources \
260
- --mount=type=bind,from=nginx-files,src=debian-agent-11.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
257
+ --mount=type=bind,from=nginx-files,src=nap-waf-12.sources,target=/tmp/app-protect.sources \
258
+ --mount=type=bind,from=nginx-files,src=nap-dos-12.sources,target=/tmp/app-protect-dos.sources \
259
+ --mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
261
260
--mount=type=bind,from=nginx-files,src=agent.sh,target=/usr/local/bin/agent.sh \
262
261
--mount=type=bind,from=nginx-files,src=nap-waf.sh,target=/usr/local/bin/nap-waf.sh \
263
262
--mount=type=bind,from=nginx-files,src=nap-dos.sh,target=/usr/local/bin/nap-dos.sh \
264
- # # the code below is duplicated from the debian-plus image because NAP doesn't support debian 12
265
263
if [ -z "${NAP_MODULES##*waf*}" ]; then \
266
264
cp /tmp/app-protect.sources /etc/apt/sources.list.d/app-protect.sources; \
267
265
fi \
268
266
&& if [ -z "${NAP_MODULES##*dos*}" ]; then \
269
267
cp /tmp/app-protect-dos.sources /etc/apt/sources.list.d/app-protect-dos.sources; \
270
268
fi \
271
269
&& apt-get update \
272
- && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gpg \
273
- && groupadd --system --gid 101 nginx \
274
- && useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
275
- && gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg /tmp/nginx_signing.key \
276
- && gpg --dearmor -o /usr/share/keyrings/app-protect-archive-keyring.gpg /tmp/app-protect-security-updates.key \
277
- && apt-get update \
278
- && 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 libcap2-bin libcurl4 \
279
- # # end of duplicated code
280
270
&& if [ "${NGINX_AGENT}" = "true" ]; then apt-get install --no-install-recommends --no-install-suggests -y nginx-agent; fi \
281
271
&& if [ -z "${NAP_MODULES##*waf*}" ]; then \
282
272
apt-get install --no-install-recommends --no-install-suggests -y app-protect app-protect-attack-signatures app-protect-threat-campaigns; \
283
273
fi \
284
274
&& if [ -z "${NAP_MODULES##*dos*}" ]; then \
285
275
apt-get install --no-install-recommends --no-install-suggests -y app-protect-dos; \
286
276
fi \
287
- && apt-get purge --auto-remove -y gpg \
288
- # # the code below is duplicated from the debian-plus image because NAP doesn't support debian 12
289
- && 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/ \
290
- && ldconfig \
291
- # # end of duplicated code
292
277
&& if [ -z "${NAP_MODULES##*waf*}" ]; then \
293
278
rm -f /etc/apt/sources.list.d/app-protect.sources; \
294
279
fi \
295
280
&& if [ -z "${NAP_MODULES##*dos*}" ]; then \
296
281
rm -f /etc/apt/sources.list.d/app-protect-dos.sources; \
297
282
fi \
298
283
&& rm -rf /var/lib/apt/lists/* \
299
- && if [ -z "${NAP_MODULES##*waf*}" ]; then \
300
- nap-waf.sh \
301
- && if [ "${NGINX_AGENT}" = "true" ]; then \
302
- agent.sh \
303
- ; fi \
304
- ; fi \
305
- && if [ -z "${NAP_MODULES##*dos*}" ]; then \
306
- nap-dos.sh \
307
- ; fi
284
+ && if [ -z "${NAP_MODULES##*waf*}" ]; then nap-waf.sh; fi \
285
+ && if [ "${NGINX_AGENT}" = "true" ]; then agent.sh; fi \
286
+ && if [ -z "${NAP_MODULES##*dos*}" ]; then nap-dos.sh; fi
308
287
309
288
# ############################################ Base image for Debian with NGINX Plus and App Protect WAFv5/DoS #############################################
310
289
FROM debian-plus as debian-plus-nap-v5
@@ -320,7 +299,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
320
299
--mount=type=bind,from=nginx-files,src=nap-waf-v5-12.sources,target=/tmp/app-protect.sources \
321
300
--mount=type=bind,from=nginx-files,src=agent.sh,target=/usr/local/bin/agent.sh \
322
301
--mount=type=bind,from=nginx-files,src=nap-waf.sh,target=/usr/local/bin/nap-waf.sh \
323
- --mount=type=bind,from=nginx-files,src=debian-agent-11 .sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
302
+ --mount=type=bind,from=nginx-files,src=debian-agent-12 .sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
324
303
if [ -z "${NAP_MODULES##*waf*}" ]; then \
325
304
cp /tmp/app-protect.sources /etc/apt/sources.list.d/app-protect.sources; \
326
305
fi \
0 commit comments