From 7f143d70bccc1d12a1970585a1a6524c8354f174 Mon Sep 17 00:00:00 2001 From: "Sergey A. Osokin" Date: Thu, 3 Dec 2020 22:13:31 -0500 Subject: [PATCH 1/2] Use mkdir(1) just once. The mkdir(1) utility support multiple arguments, so it's possible to use it once to create more than one directory. --- build/Dockerfile | 4 ++-- build/DockerfileForAlpine | 2 +- build/DockerfileForPlus | 4 ++-- build/DockerfileWithOpentracing | 4 ++-- build/DockerfileWithOpentracingForPlus | 4 ++-- build/appprotect/DockerfileWithAppProtectForPlus | 14 +++++++------- .../DockerfileWithAppProtectForPlusForOpenShift | 14 +++++++------- build/openshift/Dockerfile | 4 ++-- build/openshift/DockerfileForPlus | 4 ++-- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index a9f55e60a0..2039b0e525 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -9,8 +9,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && apt-get update \ && apt-get install -y libcap2-bin \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ diff --git a/build/DockerfileForAlpine b/build/DockerfileForAlpine index 21f4af1a61..441b8f9f14 100644 --- a/build/DockerfileForAlpine +++ b/build/DockerfileForAlpine @@ -10,7 +10,7 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ RUN mkdir -p /etc/nginx/secrets \ && mkdir -p /etc/nginx/stream-conf.d \ - && mkdir -p /var/lib/nginx \ + /var/lib/nginx \ && apk add --no-cache libcap \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \ diff --git a/build/DockerfileForPlus b/build/DockerfileForPlus index ebe1a32f89..9297acbb02 100644 --- a/build/DockerfileForPlus +++ b/build/DockerfileForPlus @@ -52,8 +52,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && chown -R nginx:0 /etc/nginx \ && chown -R nginx:0 /var/cache/nginx \ && chown -R nginx:0 /var/lib/nginx/ \ diff --git a/build/DockerfileWithOpentracing b/build/DockerfileWithOpentracing index 19a89e3a6b..165dd58d8b 100644 --- a/build/DockerfileWithOpentracing +++ b/build/DockerfileWithOpentracing @@ -75,8 +75,8 @@ COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/loc RUN ldconfig RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && apt-get update \ && apt-get install -y libcap2-bin \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ diff --git a/build/DockerfileWithOpentracingForPlus b/build/DockerfileWithOpentracingForPlus index 99d178d082..e7c523a625 100644 --- a/build/DockerfileWithOpentracingForPlus +++ b/build/DockerfileWithOpentracingForPlus @@ -68,8 +68,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/local/lib/libjaegertracing_plugin.so RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && chown -R nginx:0 /etc/nginx \ && chown -R nginx:0 /var/cache/nginx \ && chown -R nginx:0 /var/lib/nginx/ \ diff --git a/build/appprotect/DockerfileWithAppProtectForPlus b/build/appprotect/DockerfileWithAppProtectForPlus index 2ccbf5d87e..5083c42202 100644 --- a/build/appprotect/DockerfileWithAppProtectForPlus +++ b/build/appprotect/DockerfileWithAppProtectForPlus @@ -75,13 +75,13 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/stream-conf.d \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/waf \ - && mkdir -p /etc/nginx/waf/nac-policies \ - && mkdir -p /etc/nginx/waf/nac-logconfs \ - && mkdir -p /var/log/app_protect \ - && mkdir -p /opt/app_protect \ + /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/waf \ + /etc/nginx/waf/nac-policies \ + /etc/nginx/waf/nac-logconfs \ + /var/log/app_protect \ + /opt/app_protect \ && chown -R nginx:0 /etc/app_protect \ && chown -R nginx:0 /usr/share/ts \ && chown -R nginx:0 /etc/nginx \ diff --git a/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift b/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift index cb36dc6521..47106b272c 100644 --- a/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift +++ b/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift @@ -75,13 +75,13 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/stream-conf.d \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/waf \ - && mkdir -p /etc/nginx/waf/nac-policies \ - && mkdir -p /etc/nginx/waf/nac-logconfs \ - && mkdir -p /var/log/app_protect \ - && mkdir -p /opt/app_protect \ + /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/waf \ + /etc/nginx/waf/nac-policies \ + /etc/nginx/waf/nac-logconfs \ + /var/log/app_protect \ + /opt/app_protect \ && chown -R nginx:0 /etc/app_protect \ && chown -R nginx:0 /usr/share/ts \ && chown -R nginx:0 /etc/nginx \ diff --git a/build/openshift/Dockerfile b/build/openshift/Dockerfile index 67714aa8ff..99a6357506 100644 --- a/build/openshift/Dockerfile +++ b/build/openshift/Dockerfile @@ -22,8 +22,8 @@ RUN set -x \ && echo "module_hotfixes=true" >> /etc/yum.repos.d/nginx.repo \ && yum install -y nginx-${NGINX_VERSION} \ && mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \ && chown -R nginx:0 /etc/nginx \ diff --git a/build/openshift/DockerfileForPlus b/build/openshift/DockerfileForPlus index 78a093b98b..954d1af12f 100644 --- a/build/openshift/DockerfileForPlus +++ b/build/openshift/DockerfileForPlus @@ -59,8 +59,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - && mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && chown -R nginx:0 /etc/nginx \ && chown -R nginx:0 /var/cache/nginx \ && chown -R nginx:0 /var/lib/nginx/ \ From 6dfab2283e9ab98491c180c49082246eab2d2811 Mon Sep 17 00:00:00 2001 From: "Sergey A. Osokin" Date: Tue, 8 Dec 2020 11:46:40 -0500 Subject: [PATCH 2/2] Use tabs instead of spaces. --- build/Dockerfile | 4 ++-- build/DockerfileForAlpine | 4 ++-- build/DockerfileForPlus | 4 ++-- build/DockerfileWithOpentracing | 4 ++-- build/DockerfileWithOpentracingForPlus | 4 ++-- build/appprotect/DockerfileWithAppProtectForPlus | 14 +++++++------- .../DockerfileWithAppProtectForPlusForOpenShift | 14 +++++++------- build/openshift/Dockerfile | 4 ++-- build/openshift/DockerfileForPlus | 4 ++-- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 2039b0e525..04eb408ddc 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -9,8 +9,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - /etc/nginx/secrets \ - /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && apt-get update \ && apt-get install -y libcap2-bin \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ diff --git a/build/DockerfileForAlpine b/build/DockerfileForAlpine index 441b8f9f14..3c5d396a46 100644 --- a/build/DockerfileForAlpine +++ b/build/DockerfileForAlpine @@ -9,8 +9,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /etc/nginx/secrets \ - && mkdir -p /etc/nginx/stream-conf.d \ - /var/lib/nginx \ + /etc/nginx/stream-conf.d \ + /var/lib/nginx \ && apk add --no-cache libcap \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \ diff --git a/build/DockerfileForPlus b/build/DockerfileForPlus index 9297acbb02..f52f96d027 100644 --- a/build/DockerfileForPlus +++ b/build/DockerfileForPlus @@ -52,8 +52,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - /etc/nginx/secrets \ - /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && chown -R nginx:0 /etc/nginx \ && chown -R nginx:0 /var/cache/nginx \ && chown -R nginx:0 /var/lib/nginx/ \ diff --git a/build/DockerfileWithOpentracing b/build/DockerfileWithOpentracing index 165dd58d8b..5900c5b65a 100644 --- a/build/DockerfileWithOpentracing +++ b/build/DockerfileWithOpentracing @@ -75,8 +75,8 @@ COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/loc RUN ldconfig RUN mkdir -p /var/lib/nginx \ - /etc/nginx/secrets \ - /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && apt-get update \ && apt-get install -y libcap2-bin \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ diff --git a/build/DockerfileWithOpentracingForPlus b/build/DockerfileWithOpentracingForPlus index e7c523a625..28f13ba13d 100644 --- a/build/DockerfileWithOpentracingForPlus +++ b/build/DockerfileWithOpentracingForPlus @@ -68,8 +68,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/local/lib/libjaegertracing_plugin.so RUN mkdir -p /var/lib/nginx \ - /etc/nginx/secrets \ - /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && chown -R nginx:0 /etc/nginx \ && chown -R nginx:0 /var/cache/nginx \ && chown -R nginx:0 /var/lib/nginx/ \ diff --git a/build/appprotect/DockerfileWithAppProtectForPlus b/build/appprotect/DockerfileWithAppProtectForPlus index 5083c42202..68b7db22b7 100644 --- a/build/appprotect/DockerfileWithAppProtectForPlus +++ b/build/appprotect/DockerfileWithAppProtectForPlus @@ -75,13 +75,13 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - /etc/nginx/stream-conf.d \ - /etc/nginx/secrets \ - /etc/nginx/waf \ - /etc/nginx/waf/nac-policies \ - /etc/nginx/waf/nac-logconfs \ - /var/log/app_protect \ - /opt/app_protect \ + /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/waf \ + /etc/nginx/waf/nac-policies \ + /etc/nginx/waf/nac-logconfs \ + /var/log/app_protect \ + /opt/app_protect \ && chown -R nginx:0 /etc/app_protect \ && chown -R nginx:0 /usr/share/ts \ && chown -R nginx:0 /etc/nginx \ diff --git a/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift b/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift index 47106b272c..6413b8519e 100644 --- a/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift +++ b/build/appprotect/DockerfileWithAppProtectForPlusForOpenShift @@ -75,13 +75,13 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - /etc/nginx/stream-conf.d \ - /etc/nginx/secrets \ - /etc/nginx/waf \ - /etc/nginx/waf/nac-policies \ - /etc/nginx/waf/nac-logconfs \ - /var/log/app_protect \ - /opt/app_protect \ + /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/waf \ + /etc/nginx/waf/nac-policies \ + /etc/nginx/waf/nac-logconfs \ + /var/log/app_protect \ + /opt/app_protect \ && chown -R nginx:0 /etc/app_protect \ && chown -R nginx:0 /usr/share/ts \ && chown -R nginx:0 /etc/nginx \ diff --git a/build/openshift/Dockerfile b/build/openshift/Dockerfile index 99a6357506..fcc6e66bc5 100644 --- a/build/openshift/Dockerfile +++ b/build/openshift/Dockerfile @@ -22,8 +22,8 @@ RUN set -x \ && echo "module_hotfixes=true" >> /etc/yum.repos.d/nginx.repo \ && yum install -y nginx-${NGINX_VERSION} \ && mkdir -p /var/lib/nginx \ - /etc/nginx/secrets \ - /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \ 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \ && chown -R nginx:0 /etc/nginx \ diff --git a/build/openshift/DockerfileForPlus b/build/openshift/DockerfileForPlus index 954d1af12f..0fe65d5088 100644 --- a/build/openshift/DockerfileForPlus +++ b/build/openshift/DockerfileForPlus @@ -59,8 +59,8 @@ RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \ && ln -sf /proc/1/fd/2 /var/log/nginx/error.log RUN mkdir -p /var/lib/nginx \ - /etc/nginx/secrets \ - /etc/nginx/stream-conf.d \ + /etc/nginx/secrets \ + /etc/nginx/stream-conf.d \ && chown -R nginx:0 /etc/nginx \ && chown -R nginx:0 /var/cache/nginx \ && chown -R nginx:0 /var/lib/nginx/ \