Browse Source

docker: Support starting as a non-root user (fixes #6832) (#6835)

HansK-p 5 years ago
parent
commit
cd8e1ec738
1 changed files with 7 additions and 3 deletions
  1. 7 3
      script/docker-entrypoint.sh

+ 7 - 3
script/docker-entrypoint.sh

@@ -2,6 +2,10 @@
 
 
 set -eu
 set -eu
 
 
-chown "${PUID}:${PGID}" "${HOME}" \
-  && exec su-exec "${PUID}:${PGID}" \
-     env HOME="$HOME" "$@"
+if [ "$(id -u)" = '0' ]; then
+  chown "${PUID}:${PGID}" "${HOME}" \
+    && exec su-exec "${PUID}:${PGID}" \
+       env HOME="$HOME" "$@"
+else
+  exec "$@"
+fi