docker: Allow start even if chown fails (fixes #9133) (#9152)

This commit is contained in:
Jakob Borg 2023-10-07 04:12:07 +02:00 committed by GitHub
parent a64ae36bcc
commit 9f8e6966d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -14,8 +14,10 @@ if [ "$(id -u)" = '0' ]; then
setcap "$PCAP" "$binary"
fi
chown "${PUID}:${PGID}" "${HOME}" \
&& exec su-exec "${PUID}:${PGID}" \
# Chown may fail, which may cause us to be unable to start; but maybe
# it'll work anyway, so we let the error slide.
chown "${PUID}:${PGID}" "${HOME}" || true
exec su-exec "${PUID}:${PGID}" \
env HOME="$HOME" "$@"
else
exec "$@"