diff --git a/images/elasticsearch/7.16/Dockerfile b/images/elasticsearch/7.16/Dockerfile new file mode 100644 index 00000000..b376b095 --- /dev/null +++ b/images/elasticsearch/7.16/Dockerfile @@ -0,0 +1,15 @@ +FROM docker.elastic.co/elasticsearch/elasticsearch:7.16.3 + +RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml +RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml +RUN bin/elasticsearch-plugin install -b analysis-icu && \ + bin/elasticsearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.16/docker-entrypoint.sh b/images/elasticsearch/7.16/docker-entrypoint.sh new file mode 100755 index 00000000..e2c63c4c --- /dev/null +++ b/images/elasticsearch/7.16/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$ES_PLUGINS" ]]; then + echo "Installing plugins: $ES_PLUGNS" + for PLUGIN in $ES_PLUGINS + do + ./bin/elasticsearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.16/docker-healthcheck.sh b/images/elasticsearch/7.16/docker-healthcheck.sh new file mode 100644 index 00000000..a6d853cf --- /dev/null +++ b/images/elasticsearch/7.16/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/elasticsearch/7.17/Dockerfile b/images/elasticsearch/7.17/Dockerfile new file mode 100644 index 00000000..388004ce --- /dev/null +++ b/images/elasticsearch/7.17/Dockerfile @@ -0,0 +1,15 @@ +FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.8 + +RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml +RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml +RUN bin/elasticsearch-plugin install -b analysis-icu && \ + bin/elasticsearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.17/docker-entrypoint.sh b/images/elasticsearch/7.17/docker-entrypoint.sh new file mode 100755 index 00000000..e2c63c4c --- /dev/null +++ b/images/elasticsearch/7.17/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$ES_PLUGINS" ]]; then + echo "Installing plugins: $ES_PLUGNS" + for PLUGIN in $ES_PLUGINS + do + ./bin/elasticsearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.17/docker-healthcheck.sh b/images/elasticsearch/7.17/docker-healthcheck.sh new file mode 100644 index 00000000..a6d853cf --- /dev/null +++ b/images/elasticsearch/7.17/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1