Skip to content

Commit

Permalink
Use mkdir(1) just once in dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
osokin authored Dec 15, 2020
1 parent 26777a3 commit 92c0bde
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 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
4 changes: 2 additions & 2 deletions build/DockerfileForAlpine
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 /etc/nginx/secrets \
&& mkdir -p /etc/nginx/stream-conf.d \
&& mkdir -p /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 \
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 \
/var/cache/nginx \
/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 \
/var/cache/nginx \
/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 \
/usr/share/ts \
/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 \
/usr/share/ts \
/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 \
/var/cache/nginx \
/var/lib/nginx/ \
Expand Down

0 comments on commit 92c0bde

Please sign in to comment.