Skip to content

Commit 789223d

Browse files
committed
fix: multiple plugin install
1 parent 023965f commit 789223d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

entrypoint.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ docker network create elastic
1212
PLUGINS_STR=`echo ${PLUGINS} | sed -e 's/\n/ /g'`
1313
MAJOR_VERSION=`echo ${STACK_VERSION} | cut -c 1`
1414

15+
PLUGIN_INSTALL_CMD=""
16+
17+
if [ "x${PLUGINS_STR}" != "x" ]; then
18+
ARRAY=(${PLUGINS_STR})
19+
for i in ${ARRAY}
20+
do
21+
PLUGIN_INSTALL_CMD+="elasticsearch-plugin install --batch ${i} &&"
22+
done
23+
fi
24+
1525
# single node only
1626
if [ "x${MAJOR_VERSION}" == 'x6' ]; then
1727
docker run \
@@ -31,7 +41,7 @@ if [ "x${MAJOR_VERSION}" == 'x6' ]; then
3141
--name="es1" \
3242
--entrypoint="" \
3343
docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION} \
34-
/bin/sh -vc "elasticsearch-plugin install --batch ${PLUGINS_STR} && /usr/local/bin/docker-entrypoint.sh"
44+
/bin/sh -vc "${PLUGIN_INSTALL_CMD} /usr/local/bin/docker-entrypoint.sh"
3545
elif [ "x${MAJOR_VERSION}" == 'x7' ]; then
3646
docker run \
3747
--rm \
@@ -52,7 +62,7 @@ elif [ "x${MAJOR_VERSION}" == 'x7' ]; then
5262
--name="es1" \
5363
--entrypoint="" \
5464
docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION} \
55-
/bin/sh -vc "elasticsearch-plugin install --batch ${PLUGINS_STR} && /usr/local/bin/docker-entrypoint.sh"
65+
/bin/sh -vc "${PLUGIN_INSTALL_CMD} /usr/local/bin/docker-entrypoint.sh"
5666
fi
5767

5868
docker run \

0 commit comments

Comments
 (0)