From fa42cf263ead1671e1aa6dc3495173609173cadb Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Mon, 24 Sep 2018 15:52:13 -0700 Subject: [PATCH] Only chown things in the entrypoint that are not already owned by rabbitmq --- 3.6-rc/alpine/docker-entrypoint.sh | 2 +- 3.6-rc/debian/docker-entrypoint.sh | 2 +- 3.6-rc/docker-entrypoint.sh | 2 +- 3.6/alpine/docker-entrypoint.sh | 2 +- 3.6/debian/docker-entrypoint.sh | 2 +- 3.6/docker-entrypoint.sh | 2 +- 3.7-rc/alpine/docker-entrypoint.sh | 2 +- 3.7-rc/debian/docker-entrypoint.sh | 2 +- 3.7-rc/docker-entrypoint.sh | 2 +- 3.7/alpine/docker-entrypoint.sh | 2 +- 3.7/debian/docker-entrypoint.sh | 2 +- 3.7/docker-entrypoint.sh | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/3.6-rc/alpine/docker-entrypoint.sh b/3.6-rc/alpine/docker-entrypoint.sh index d73505de..e430676f 100755 --- a/3.6-rc/alpine/docker-entrypoint.sh +++ b/3.6-rc/alpine/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec su-exec rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.6-rc/debian/docker-entrypoint.sh b/3.6-rc/debian/docker-entrypoint.sh index 3f78ac07..2e72bc13 100755 --- a/3.6-rc/debian/docker-entrypoint.sh +++ b/3.6-rc/debian/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.6-rc/docker-entrypoint.sh b/3.6-rc/docker-entrypoint.sh index 3f78ac07..2e72bc13 100755 --- a/3.6-rc/docker-entrypoint.sh +++ b/3.6-rc/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.6/alpine/docker-entrypoint.sh b/3.6/alpine/docker-entrypoint.sh index 3ad149e6..b2bfc3d8 100755 --- a/3.6/alpine/docker-entrypoint.sh +++ b/3.6/alpine/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec su-exec rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.6/debian/docker-entrypoint.sh b/3.6/debian/docker-entrypoint.sh index 861561ad..5be24135 100755 --- a/3.6/debian/docker-entrypoint.sh +++ b/3.6/debian/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.6/docker-entrypoint.sh b/3.6/docker-entrypoint.sh index 861561ad..5be24135 100755 --- a/3.6/docker-entrypoint.sh +++ b/3.6/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.7-rc/alpine/docker-entrypoint.sh b/3.7-rc/alpine/docker-entrypoint.sh index cd806cbf..c3fa15e7 100755 --- a/3.7-rc/alpine/docker-entrypoint.sh +++ b/3.7-rc/alpine/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec su-exec rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.7-rc/debian/docker-entrypoint.sh b/3.7-rc/debian/docker-entrypoint.sh index 99ae42be..464c96a1 100755 --- a/3.7-rc/debian/docker-entrypoint.sh +++ b/3.7-rc/debian/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.7-rc/docker-entrypoint.sh b/3.7-rc/docker-entrypoint.sh index 99ae42be..464c96a1 100755 --- a/3.7-rc/docker-entrypoint.sh +++ b/3.7-rc/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.7/alpine/docker-entrypoint.sh b/3.7/alpine/docker-entrypoint.sh index cd806cbf..c3fa15e7 100755 --- a/3.7/alpine/docker-entrypoint.sh +++ b/3.7/alpine/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec su-exec rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.7/debian/docker-entrypoint.sh b/3.7/debian/docker-entrypoint.sh index 99ae42be..464c96a1 100755 --- a/3.7/debian/docker-entrypoint.sh +++ b/3.7/debian/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi diff --git a/3.7/docker-entrypoint.sh b/3.7/docker-entrypoint.sh index 99ae42be..464c96a1 100755 --- a/3.7/docker-entrypoint.sh +++ b/3.7/docker-entrypoint.sh @@ -26,7 +26,7 @@ file_env() { # allow the container to be started with `--user` if [[ "$1" == rabbitmq* ]] && [ "$(id -u)" = '0' ]; then if [ "$1" = 'rabbitmq-server' ]; then - chown -R rabbitmq /var/lib/rabbitmq + find /var/lib/rabbitmq \! -user rabbitmq -exec chown rabbitmq '{}' + fi exec gosu rabbitmq "$BASH_SOURCE" "$@" fi