Skip to content

Commit 00a17f1

Browse files
committed
fix: for 6
1 parent 4193ff9 commit 00a17f1

File tree

1 file changed

+42
-19
lines changed

1 file changed

+42
-19
lines changed

entrypoint.sh

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,50 @@ fi
1010
docker network create elastic
1111

1212
PLUGINS_STR=`echo ${PLUGINS} | sed -e 's/\n/ /g'`
13+
MAJOR_VERSION=`echo ${STACK_VERSION} | cut -c 1`
1314

1415
# single node only
15-
docker run \
16-
--rm \
17-
--env "node.name=es1" \
18-
--env "cluster.name=docker-elasticsearch" \
19-
--env "cluster.initial_master_nodes=es1" \
20-
--env "discovery.seed_hosts=es1" \
21-
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
22-
--env "bootstrap.memory_lock=true" \
23-
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
24-
--env "xpack.security.enabled=false" \
25-
--env "xpack.license.self_generated.type=basic" \
26-
--ulimit nofile=65536:65536 \
27-
--ulimit memlock=-1:-1 \
28-
--publish "9200:9200" \
29-
--network=elastic \
30-
--name="es1" \
31-
--entrypoint="" \
32-
docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION} \
33-
/bin/sh -vc "elasticsearch-plugin install --batch ${PLUGINS_STR} && /usr/local/bin/docker-entrypoint.sh"
16+
if [ "x${MAJOR_VERSION}" == 'x6' ]; then
17+
docker run \
18+
--rm \
19+
--env "node.name=es1" \
20+
--env "cluster.name=docker-elasticsearch" \
21+
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
22+
--env "bootstrap.memory_lock=true" \
23+
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
24+
--env "xpack.security.enabled=false" \
25+
--env "xpack.license.self_generated.type=basic" \
26+
--ulimit nofile=65536:65536 \
27+
--ulimit memlock=-1:-1 \
28+
--publish "9200:9200" \
29+
--detach \
30+
--network=elastic \
31+
--name="es1" \
32+
--entrypoint="" \
33+
docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION} \
34+
/bin/sh -vc "elasticsearch-plugin install --batch ${PLUGINS_STR} && /usr/local/bin/docker-entrypoint.sh"
35+
elif [ "x${MAJOR_VERSION}" == 'x7' ]; then
36+
docker run \
37+
--rm \
38+
--env "node.name=es1" \
39+
--env "cluster.name=docker-elasticsearch" \
40+
--env "cluster.initial_master_nodes=es1" \
41+
--env "discovery.seed_hosts=es1" \
42+
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
43+
--env "bootstrap.memory_lock=true" \
44+
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
45+
--env "xpack.security.enabled=false" \
46+
--env "xpack.license.self_generated.type=basic" \
47+
--ulimit nofile=65536:65536 \
48+
--ulimit memlock=-1:-1 \
49+
--publish "9200:9200" \
50+
--detach \
51+
--network=elastic \
52+
--name="es1" \
53+
--entrypoint="" \
54+
docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION} \
55+
/bin/sh -vc "elasticsearch-plugin install --batch ${PLUGINS_STR} && /usr/local/bin/docker-entrypoint.sh"
56+
fi
3457

3558
docker run \
3659
--network elastic \

0 commit comments

Comments
 (0)