From 12e09be6df7964f25010d6d1a54f1e8898e3c387 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Mon, 6 Dec 2021 14:59:59 +0100 Subject: [PATCH] doc: add comments in entrypoint --- docker/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index f3ebfff..19d1dca 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -9,10 +9,12 @@ echo "Arguments: $ARGS" EXT_UID=${EXT_UID:-999} EXT_GID=${EXT_GID:-999} +# Create user with given ID if needed if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then groupadd -g "$EXT_GID" appuser fi +# Create group with given ID if needed if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then useradd -r -u "$EXT_UID" -g appuser appuser fi @@ -27,4 +29,3 @@ if [ "$1" = "shell" ]; then else exec gosu "$EXT_UID:$EXT_GID" make "$@" fi -