adding universal umask setting using an contenv wrapper

This commit is contained in:
thelamer 2020-05-09 13:50:46 -07:00 committed by Ryan Kuba
parent ca312610e3
commit b158c2e0d6
4 changed files with 13 additions and 0 deletions

View file

@ -60,6 +60,7 @@ RUN \
bash \
ca-certificates \
coreutils \
procps \
shadow \
tzdata && \
echo "**** add s6 overlay ****" && \
@ -76,6 +77,7 @@ RUN \
/app \
/config \
/defaults && \
mv /usr/bin/with-contenv /usr/bin/with-contenvb && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \

View file

@ -60,6 +60,7 @@ RUN \
bash \
ca-certificates \
coreutils \
procps \
shadow \
tzdata && \
echo "**** add s6 overlay ****" && \
@ -76,6 +77,7 @@ RUN \
/app \
/config \
/defaults && \
mv /usr/bin/with-contenv /usr/bin/with-contenvb && \
echo "**** add qemu ****" && \
curl -o \
/usr/bin/qemu-aarch64-static -L \

View file

@ -60,6 +60,7 @@ RUN \
bash \
ca-certificates \
coreutils \
procps \
shadow \
tzdata && \
echo "**** add s6 overlay ****" && \
@ -76,6 +77,7 @@ RUN \
/app \
/config \
/defaults && \
mv /usr/bin/with-contenv /usr/bin/with-contenvb && \
echo "**** add qemu ****" && \
curl -o \
/usr/bin/qemu-arm-static -L \

7
root/usr/bin/with-contenv Executable file
View file

@ -0,0 +1,7 @@
#! /bin/bash
if [[ -f /var/run/s6/container_environment/UMASK ]] && [[ "$(pwdx $$)" =~ "/run/s6/services/" ]]; then
umask $(cat /var/run/s6/container_environment/UMASK)
/usr/bin/with-contenvb "$@"
else
/usr/bin/with-contenvb "$@"
fi