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

View file

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

View file

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