From fd5ea069ea4f0b11c44a92c5a06c18d14a05ea8c Mon Sep 17 00:00:00 2001 From: Jo Date: Sun, 16 Oct 2022 22:04:11 +0200 Subject: [PATCH] - upgrading the docker example to use ES=8, running in compatibility mode (so we don't break the python client) (#985) --- docker/examples/elastic/ES/Dockerfile | 9 ++++----- docker/examples/elastic/docker-compose.yml | 4 ++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docker/examples/elastic/ES/Dockerfile b/docker/examples/elastic/ES/Dockerfile index 88b694d..7906f11 100644 --- a/docker/examples/elastic/ES/Dockerfile +++ b/docker/examples/elastic/ES/Dockerfile @@ -31,7 +31,7 @@ # # ================================================================= -FROM docker.elastic.co/elasticsearch/elasticsearch:7.5.1 +FROM docker.elastic.co/elasticsearch/elasticsearch:8.4.0 LABEL maintainer="jorge.dejesus@geocat.net justb4@gmail.com" ARG DATA_FOLDER=/usr/share/elasticsearch/data @@ -41,7 +41,7 @@ USER root COPY docker-entrypoint.sh /docker-entrypoint.sh COPY add_data.sh /add_data.sh -RUN yum install -y wget +RUN apt update && apt install -y wget RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O bin/wait-for-it.sh RUN chmod +x bin/wait-for-it.sh @@ -52,10 +52,9 @@ RUN echo "xpack.security.enabled: false" >> config/elasticsearch.yml RUN echo "http.host: 0.0.0.0" >> config/elasticsearch.yml RUN echo "discovery.type: single-node" >> config/elasticsearch.yml -RUN yum --enablerepo=extras -y install epel-release \ - && yum install -y python3 python3-pip python3-setuptools python-typing \ +RUN apt install -y python3 python3-pip python3-setuptools python-typing \ && pip3 install --upgrade pip elasticsearch==7.17.1 elasticsearch-dsl \ - && yum clean packages + && apt clean packages USER elasticsearch diff --git a/docker/examples/elastic/docker-compose.yml b/docker/examples/elastic/docker-compose.yml index c1dec87..baf2995 100644 --- a/docker/examples/elastic/docker-compose.yml +++ b/docker/examples/elastic/docker-compose.yml @@ -62,6 +62,10 @@ services: ports: - 9300:9300 - 9200:9200 + environment: + ELASTIC_CLIENT_APIVERSIONING: 1 + # Enabling compatibility mode in ES + # https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/migration.html#migration-compat-mode volumes: - elastic_search_data:/usr/share/elasticsearch/data