Skip to content

Commit

Permalink
Use mkdir(1) just once.
Browse files Browse the repository at this point in the history
The mkdir(1) utility support multiple arguments, so it's possible
to use it once to create more than one directory.
  • Loading branch information
osokin committed Dec 4, 2020
1 parent 095a751 commit 7f143d7
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion build/DockerfileForAlpine
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -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/ \
Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileWithOpentracing
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileWithOpentracingForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -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/ \
Expand Down
14 changes: 7 additions & 7 deletions build/appprotect/DockerfileWithAppProtectForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
14 changes: 7 additions & 7 deletions build/appprotect/DockerfileWithAppProtectForPlusForOpenShift
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions build/openshift/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions build/openshift/DockerfileForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -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/ \
Expand Down

0 comments on commit 7f143d7

Please sign in to comment.