Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use chown(8) only once #1263

Merged
merged 3 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ RUN mkdir -p /var/lib/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
&& chown -R nginx:0 /etc/nginx \
&& chown -R nginx:0 /var/cache/nginx \
&& chown -R nginx:0 /var/lib/nginx \
/var/cache/nginx \
/var/lib/nginx \
&& apt-get remove --purge -y libcap2-bin \
&& rm /etc/nginx/conf.d/* \
&& rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileForAlpine
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN mkdir -p /etc/nginx/secrets \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
&& chown -R nginx:0 /etc/nginx \
&& chown -R nginx:0 /var/cache/nginx \
&& chown -R nginx:0 /var/lib/nginx \
/var/cache/nginx \
/var/lib/nginx \
&& apk del libcap \
&& rm /etc/nginx/conf.d/* \
&& rm -rf /var/cache/apk/*
Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ RUN mkdir -p /var/lib/nginx \
&& mkdir -p /etc/nginx/secrets \
&& mkdir -p /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/ \
/var/cache/nginx \
/var/lib/nginx/ \
&& apt-get remove --purge -y libcap2-bin \
&& rm /etc/nginx/conf.d/*

Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileWithOpentracing
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ RUN mkdir -p /var/lib/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
&& chown -R nginx:0 /etc/nginx \
&& chown -R nginx:0 /var/cache/nginx \
&& chown -R nginx:0 /var/lib/nginx \
/var/cache/nginx \
/var/lib/nginx \
&& apt-get remove --purge -y libcap2-bin \
&& rm /etc/nginx/conf.d/* \
&& rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions build/DockerfileWithOpentracingForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ RUN mkdir -p /var/lib/nginx \
&& mkdir -p /etc/nginx/secrets \
&& mkdir -p /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/ \
/var/cache/nginx \
/var/lib/nginx/ \
&& apt-get remove --purge -y libcap2-bin \
&& rm /etc/nginx/conf.d/*

Expand Down
14 changes: 7 additions & 7 deletions build/appprotect/DockerfileWithAppProtectForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ RUN mkdir -p /var/lib/nginx \
&& mkdir -p /var/log/app_protect \
&& mkdir -p /opt/app_protect \
&& chown -R nginx:0 /etc/app_protect \
&& chown -R nginx:0 /usr/share/ts \
&& chown -R nginx:0 /etc/nginx \
&& chown -R nginx:0 /var/cache/nginx \
&& chown -R nginx:0 /var/lib/nginx/ \
&& chown -R nginx:0 /var/log/app_protect/ \
&& chown -R nginx:0 /opt/app_protect/ \
&& chown -R nginx:0 /var/log/nginx/ \
/usr/share/ts \
/etc/nginx \
/var/cache/nginx \
/var/lib/nginx/ \
/var/log/app_protect/ \
/opt/app_protect/ \
/var/log/nginx/ \
&& apt-get remove --purge -y libcap2-bin \
&& rm /etc/nginx/conf.d/*

Expand Down
14 changes: 7 additions & 7 deletions build/appprotect/DockerfileWithAppProtectForPlusForOpenShift
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ RUN mkdir -p /var/lib/nginx \
&& mkdir -p /var/log/app_protect \
&& mkdir -p /opt/app_protect \
&& chown -R nginx:0 /etc/app_protect \
&& chown -R nginx:0 /usr/share/ts \
&& chown -R nginx:0 /etc/nginx \
&& chown -R nginx:0 /var/cache/nginx \
&& chown -R nginx:0 /var/lib/nginx/ \
&& chown -R nginx:0 /var/log/app_protect/ \
&& chown -R nginx:0 /opt/app_protect/ \
&& chown -R nginx:0 /var/log/nginx/ \
/etc/nginx \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the order of folders here is a bit different from the file build/appprotect/DockerfileWithAppProtectForPlus.
Could we use the same order for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pleshakov I've sorted that out cause in that order it has better readility, however I can revert that one.

/opt/app_protect/ \
/usr/share/ts \
/var/cache/nginx \
/var/lib/nginx/ \
/var/log/app_protect/ \
/var/log/nginx/ \
&& rm /etc/nginx/conf.d/*

RUN printf "MODULE = ALL;\nLOG_LEVEL = TS_CRIT;\nFILE = 2;\n" > /etc/app_protect/bd/logger.cfg \
Expand Down
4 changes: 2 additions & 2 deletions build/openshift/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ RUN set -x \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
&& chown -R nginx:0 /etc/nginx \
&& chown -R nginx:0 /var/cache/nginx \
&& chown -R nginx:0 /var/lib/nginx \
/var/cache/nginx \
/var/lib/nginx \
&& rm /etc/yum.repos.d/nginx.repo \
&& rm /etc/nginx/conf.d/*

Expand Down
4 changes: 2 additions & 2 deletions build/openshift/DockerfileForPlus
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ RUN mkdir -p /var/lib/nginx \
&& mkdir -p /etc/nginx/secrets \
&& mkdir -p /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/ \
/var/cache/nginx \
/var/lib/nginx/ \
&& rm /etc/nginx/conf.d/*

EXPOSE 80 443
Expand Down