From 7f78cc8d0febeb01308a42e05aea6bfab8d67633 Mon Sep 17 00:00:00 2001 From: Michal Ciania Date: Sat, 18 Sep 2021 11:33:25 +0200 Subject: [PATCH] Substitute default values only once --- extra/entrypoint.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extra/entrypoint.sh b/extra/entrypoint.sh index 159b0c810..6dac6333c 100644 --- a/extra/entrypoint.sh +++ b/extra/entrypoint.sh @@ -1,13 +1,15 @@ #!/usr/bin/env sh set -e +PUID=${PUID=1000} +PGID=${PGID=1000} files_ownership () { - chown -hRc "${PUID=1000}":"${PGID=1000}" /app/data + chown -hRc "$PUID":"$PGID" /app/data } echo "==> Performing startup jobs and maintenance tasks" files_ownership -echo "==> Starting application with user ${PUID=1000} group ${PGID=1000}" -exec setpriv --reuid "${PUID=1000}" --regid "${PGID=1000}" --clear-groups "$@" +echo "==> Starting application with user $PUID group $PGID" +exec setpriv --reuid "$PUID" --regid "$PGID" --clear-groups "$@"