From b158c2e0d660fe3f2aa5c2d52046b7f263cda866 Mon Sep 17 00:00:00 2001 From: thelamer Date: Sat, 9 May 2020 13:50:46 -0700 Subject: [PATCH] adding universal umask setting using an contenv wrapper --- Dockerfile | 2 ++ Dockerfile.aarch64 | 2 ++ Dockerfile.armhf | 2 ++ root/usr/bin/with-contenv | 7 +++++++ 4 files changed, 13 insertions(+) create mode 100755 root/usr/bin/with-contenv diff --git a/Dockerfile b/Dockerfile index c75b96d..849ceb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 441ba27..a256660 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -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 \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index b99c3e5..54463f9 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -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 \ diff --git a/root/usr/bin/with-contenv b/root/usr/bin/with-contenv new file mode 100755 index 0000000..dff4e6a --- /dev/null +++ b/root/usr/bin/with-contenv @@ -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