-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:5.2.2 | ||
FROM elasticsearch:5.2.2 | ||
|
||
RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml | ||
RUN apt update || true \ | ||
&& apt install zip | ||
RUN zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class | ||
|
||
RUN bin/elasticsearch-plugin install analysis-icu && \ | ||
bin/elasticsearch-plugin install analysis-phonetic | ||
|
||
ADD docker-healthcheck.sh /docker-healthcheck.sh | ||
|
||
ADD docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] | ||
|
||
EXPOSE 9200 9300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Add elasticsearch as command if needed | ||
if [ "${1:0:1}" = '-' ]; then | ||
set -- elasticsearch "$@" | ||
fi | ||
|
||
# Drop root privileges if we are running elasticsearch | ||
# allow the container to be started with `--user` | ||
if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then | ||
# Change the ownership of user-mutable directories to elasticsearch | ||
for path in \ | ||
/usr/share/elasticsearch/data \ | ||
/usr/share/elasticsearch/logs \ | ||
; do | ||
chown -R elasticsearch:elasticsearch "$path" | ||
done | ||
|
||
es_opts='' | ||
|
||
while IFS='=' read -r envvar_key envvar_value | ||
do | ||
# Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` | ||
if [[ "$envvar_key" =~ ^[a-z]+\.[a-z]+ ]] | ||
then | ||
if [[ ! -z $envvar_value ]]; then | ||
es_opt="-E${envvar_key}=${envvar_value}" | ||
es_opts+=" ${es_opt}" | ||
fi | ||
fi | ||
done < <(env) | ||
|
||
set -- gosu elasticsearch "$@" ${es_opts} | ||
#exec gosu elasticsearch "$BASH_SOURCE" "$@" | ||
fi | ||
|
||
# As argument is not related to elasticsearch, | ||
# then assume that user wants to run his own process, | ||
# for example a `bash` shell to explore this image | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters