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

This commit is contained in:
HansK-p 2020-07-14 11:38:59 +02:00 committed by GitHub
parent aedc2d788f
commit cd8e1ec738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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