Browse Source

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

Jakob Borg 2 years ago
parent
commit
9f8e6966d8
1 changed files with 4 additions and 2 deletions
  1. 4 2
      script/docker-entrypoint.sh

+ 4 - 2
script/docker-entrypoint.sh

@@ -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 "$@"