Images: Use chown with : instead of ..

This commit is contained in:
Marco Ebert 2024-12-19 18:15:51 +01:00 committed by k8s-infra-cherrypick-robot
parent 7b37866670
commit 7b6837925b
5 changed files with 6 additions and 6 deletions

View file

@ -66,7 +66,7 @@ RUN apk update \
); \ ); \
for dir in "${writeDirs[@]}"; do \ for dir in "${writeDirs[@]}"; do \
mkdir -p ${dir}; \ mkdir -p ${dir}; \
chown -R www-data.www-data ${dir}; \ chown -R www-data:www-data ${dir}; \
done' done'
EXPOSE 80 443 EXPOSE 80 443

View file

@ -624,7 +624,7 @@ adduser -S -D -H -u 101 -h /usr/local/nginx -s /sbin/nologin -G www-data -g www-
for dir in "${writeDirs[@]}"; do for dir in "${writeDirs[@]}"; do
mkdir -p ${dir}; mkdir -p ${dir};
chown -R www-data.www-data ${dir}; chown -R www-data:www-data ${dir};
done done
rm -rf /etc/nginx/owasp-modsecurity-crs/.git rm -rf /etc/nginx/owasp-modsecurity-crs/.git

View file

@ -59,7 +59,7 @@ RUN bash -xeu -c ' \
); \ ); \
for dir in "${writeDirs[@]}"; do \ for dir in "${writeDirs[@]}"; do \
mkdir -p ${dir}; \ mkdir -p ${dir}; \
chown -R www-data.www-data ${dir}; \ chown -R www-data:www-data ${dir}; \
done' \ done' \
# LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules # LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules
# Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below # Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below

View file

@ -78,7 +78,7 @@ RUN bash -xeu -c ' \
); \ ); \
for dir in "${writeDirs[@]}"; do \ for dir in "${writeDirs[@]}"; do \
mkdir -p ${dir}; \ mkdir -p ${dir}; \
chown -R www-data.www-data ${dir}; \ chown -R www-data:www-data ${dir}; \
done' \ done' \
# LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules # LD_LIBRARY_PATH does not work so below is needed for opentelemetry/other modules
# Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below # Put libs of newer modules under `/modules_mount/<other>/lib` and add that path below
@ -103,7 +103,7 @@ RUN ln -sf /chroot/etc/nginx /etc/nginx \
&& touch /chroot/var/log/nginx/access.log \ && touch /chroot/var/log/nginx/access.log \
&& chown www-data:www-data /chroot/var/log/nginx/access.log \ && chown www-data:www-data /chroot/var/log/nginx/access.log \
&& echo "" > /chroot/etc/resolv.conf \ && echo "" > /chroot/etc/resolv.conf \
&& chown -R www-data.www-data /chroot/var/log/nginx /chroot/etc/resolv.conf \ && chown -R www-data:www-data /chroot/var/log/nginx /chroot/etc/resolv.conf \
&& mknod -m 0666 /chroot/dev/null c 1 3 \ && mknod -m 0666 /chroot/dev/null c 1 3 \
&& mknod -m 0666 /chroot/dev/random c 1 8 \ && mknod -m 0666 /chroot/dev/random c 1 8 \
&& mknod -m 0666 /chroot/dev/urandom c 1 9 \ && mknod -m 0666 /chroot/dev/urandom c 1 9 \

View file

@ -39,7 +39,7 @@ writeDirs=( \
for dir in "${writeDirs[@]}"; do for dir in "${writeDirs[@]}"; do
mkdir -p ${dir}; mkdir -p ${dir};
chown -R www-data.www-data ${dir}; chown -R www-data:www-data ${dir};
done done
mkdir -p /chroot/lib /chroot/proc /chroot/usr /chroot/bin /chroot/dev /chroot/run mkdir -p /chroot/lib /chroot/proc /chroot/usr /chroot/bin /chroot/dev /chroot/run