diff --git a/1.3/docker-entrypoint.sh b/1.3/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/1.3/docker-entrypoint.sh +++ b/1.3/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/1.4/docker-entrypoint.sh b/1.4/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/1.4/docker-entrypoint.sh +++ b/1.4/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/1.5/docker-entrypoint.sh b/1.5/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/1.5/docker-entrypoint.sh +++ b/1.5/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/1.6/docker-entrypoint.sh b/1.6/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/1.6/docker-entrypoint.sh +++ b/1.6/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/1.7/docker-entrypoint.sh b/1.7/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/1.7/docker-entrypoint.sh +++ b/1.7/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/2.0/docker-entrypoint.sh b/2.0/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/2.0/docker-entrypoint.sh +++ b/2.0/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/2.1/docker-entrypoint.sh b/2.1/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/2.1/docker-entrypoint.sh +++ b/2.1/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch, diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a8fca33..09dd9fc 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then fi # Drop root privileges if we are running elasticsearch -if [ "$1" = 'elasticsearch' ]; then +# allow the container to be started with `--user` +if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then # Change the ownership of /usr/share/elasticsearch/data to elasticsearch chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data - exec gosu elasticsearch "$@" + + set -- gosu elasticsearch "$@" + #exec gosu elasticsearch "$BASH_SOURCE" "$@" fi # As argument is not related to elasticsearch,