From d8354512e3efe8ec0f16ac67f445982fd878b029 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Tue, 30 Nov 2021 15:16:01 +0100 Subject: [PATCH] fix: handle user UID/GID --- docker/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 9471843..cc1d6f8 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -9,12 +9,12 @@ echo "Arguments: $ARGS" EXT_UID=${EXT_UID:-999} EXT_GID=${EXT_GID:-999} -if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then +if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then groupadd -g "$EXT_GID" appuser fi -if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then +if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then useradd -r -u "$EXT_UID" -g appuser appuser fi -exec gosu appuser make "$@" +exec gosu "$EXT_UID:$EXT_GID" make "$@"