From 24c788070f3f6e156e511341122f9d136ad468d0 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Wed, 24 Jan 2024 11:21:00 +0100 Subject: [PATCH] Sync docker-entrypoint.sh with enterprise --- docker/docker-entrypoint.sh | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index d60d1ff49..c24316f06 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -35,20 +35,7 @@ readonly gid readonly exec_cmd if [[ "$(id -u)" = "0" ]]; then - chown "${uid}":"${gid}" /opt/hivemq/data - chmod 700 /opt/hivemq/data - # Any of the following may fail but still allow HiveMQ to start normally, so lets ignore errors - set +e - chown "${uid}":"${gid}" /opt/hivemq - chown "${uid}":"${gid}" /opt/hivemq-* - chown "${uid}":"${gid}" /opt/hivemq/log - chown "${uid}":"${gid}" /opt/hivemq/conf - chown "${uid}":"${gid}" /opt/hivemq/conf/config.xml - # Recursive for bin, no volume here - chown -R "${uid}":"${gid}" /opt/hivemq/bin - chmod 700 /opt/hivemq - chmod 700 /opt/hivemq-* - chmod -R 700 /opt/hivemq/bin + find /opt \! -user "${uid}" -exec chown "${uid}" '{}' + || true fi ${exec_cmd} "$@"