File tree 8 files changed +40
-16
lines changed 8 files changed +40
-16
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ if [ "${1:0:1}" = '-' ]; then
8
8
fi
9
9
10
10
# Drop root privileges if we are running elasticsearch
11
- if [ " $1 " = ' elasticsearch' ]; then
11
+ # allow the container to be started with `--user`
12
+ if [ " $1 " = ' elasticsearch' -a " $( id -u) " = ' 0' ]; then
12
13
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
13
14
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
14
- exec gosu elasticsearch " $@ "
15
+
16
+ set -- gosu elasticsearch " $@ "
17
+ # exec gosu elasticsearch "$BASH_SOURCE" "$@"
15
18
fi
16
19
17
20
# As argument is not related to elasticsearch,
You can’t perform that action at this time.
0 commit comments