From 9ef412f5278872304939862fe92f44045d637edd Mon Sep 17 00:00:00 2001 From: stumbaumr Date: Wed, 4 Sep 2019 15:22:49 +0200 Subject: [PATCH] feat(entrypoint): Skip redundant chown ops (#200) As discussed in https://github.com/getsentry/onpremise/issues/239 with some setups this chown takes over 20 minutes. --- 9.1/docker-entrypoint.sh | 2 +- git/docker-entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 5624596..66967c3 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -18,7 +18,7 @@ if [ "$1" = 'sentry' ]; then set -- tini -- "$@" if [ "$(id -u)" = '0' ]; then mkdir -p "$SENTRY_FILESTORE_DIR" - chown -R sentry "$SENTRY_FILESTORE_DIR" + find "$SENTRY_FILESTORE_DIR" ! -user sentry -exec chown sentry {} \; set -- gosu sentry "$@" fi fi diff --git a/git/docker-entrypoint.sh b/git/docker-entrypoint.sh index 5624596..66967c3 100755 --- a/git/docker-entrypoint.sh +++ b/git/docker-entrypoint.sh @@ -18,7 +18,7 @@ if [ "$1" = 'sentry' ]; then set -- tini -- "$@" if [ "$(id -u)" = '0' ]; then mkdir -p "$SENTRY_FILESTORE_DIR" - chown -R sentry "$SENTRY_FILESTORE_DIR" + find "$SENTRY_FILESTORE_DIR" ! -user sentry -exec chown sentry {} \; set -- gosu sentry "$@" fi fi