diff --git a/elasticsearch-s3/Dockerfile.5_6_4 b/elasticsearch-s3/Dockerfile.5_6_4 deleted file mode 100644 index 8dce3e78..00000000 --- a/elasticsearch-s3/Dockerfile.5_6_4 +++ /dev/null @@ -1,8 +0,0 @@ -ARG FROM=docker.io/elasticsearch:5.6.4 -FROM ${FROM} - -RUN wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \ - && chmod +x ./jq \ - && cp jq /usr/bin - -RUN bin/elasticsearch-plugin install --batch repository-s3 diff --git a/elasticsearch-s3/Dockerfile.7 b/elasticsearch-s3/Dockerfile.7 new file mode 100644 index 00000000..ccb3868f --- /dev/null +++ b/elasticsearch-s3/Dockerfile.7 @@ -0,0 +1,17 @@ +ARG ELASTICSEARCH_VERSION +FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION} + +ARG ELASTICSEARCH_VERSION + +RUN set -ex \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + jq \ + python3-pip \ + && pip3 install --no-cache-dir --upgrade pip \ + && pip3 install --no-cache-dir \ + "elasticsearch<=${ELASTICSEARCH_VERSION}" \ + "elasticsearch-dsl~=7.0" \ + && bin/elasticsearch-plugin install --batch repository-s3 \ + && rm -rf /var/lib/apt/lists/* diff --git a/elasticsearch-s3/Dockerfile.7_1_0 b/elasticsearch-s3/Dockerfile.7_1_0 deleted file mode 100644 index 618555f1..00000000 --- a/elasticsearch-s3/Dockerfile.7_1_0 +++ /dev/null @@ -1,15 +0,0 @@ -ARG FROM=docker.elastic.co/elasticsearch/elasticsearch-oss:7.1.0 -FROM ${FROM} - -RUN wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64; \ - chmod +x ./jq ;\ - cp jq /usr/bin ;\ - yum -y update ;\ - rm -rf /var/cache/yum ;\ - curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\ - python /tmp/get-pip.py ;\ - rm -f /tmp/get-pip.py ;\ - pip install \ - elasticsearch==7.1.0 \ - elasticsearch-dsl==7.1.0; \ - bin/elasticsearch-plugin install --batch repository-s3 diff --git a/elasticsearch-s3/Dockerfile.7_6_2 b/elasticsearch-s3/Dockerfile.7_6_2 deleted file mode 100644 index 9a07e317..00000000 --- a/elasticsearch-s3/Dockerfile.7_6_2 +++ /dev/null @@ -1,11 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.6.2 - -RUN yum install -y epel-release; \ - yum update; \ - yum install -y python-pip jq; \ - pip install --upgrade pip; \ - pip install \ - elasticsearch==7.8.0 \ - elasticsearch-dsl==7.2.1; \ - bin/elasticsearch-plugin install --batch repository-s3; \ - rm -rf /var/cache/yum diff --git a/elasticsearch-s3/Dockerfile.8 b/elasticsearch-s3/Dockerfile.8 new file mode 100644 index 00000000..450ee8c8 --- /dev/null +++ b/elasticsearch-s3/Dockerfile.8 @@ -0,0 +1,12 @@ +ARG ELASTICSEARCH_VERSION +FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION} + +USER root + +RUN set -ex \ + && apt update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends jq \ + && rm -rf /var/lib/apt/lists/* + +USER elasticsearch diff --git a/elasticsearch-s3/Dockerfile.8_7_1 b/elasticsearch-s3/Dockerfile.8_7_1 deleted file mode 100644 index 27e8d57d..00000000 --- a/elasticsearch-s3/Dockerfile.8_7_1 +++ /dev/null @@ -1,9 +0,0 @@ -FROM docker.io/elasticsearch:8.7.1 - -USER root - -RUN curl -sL https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -o /usr/local/bin/jq && \ - chmod +x /usr/local/bin/jq && \ - jq --version - -USER elasticsearch \ No newline at end of file diff --git a/elasticsearch-s3/Dockerfile.8_9_0 b/elasticsearch-s3/Dockerfile.8_9_0 deleted file mode 100644 index 8d2fb705..00000000 --- a/elasticsearch-s3/Dockerfile.8_9_0 +++ /dev/null @@ -1,14 +0,0 @@ -ARG FROM=docker.elastic.co/elasticsearch/elasticsearch:8.9.0 -FROM ${FROM} - -ARG JQ_PATH=/usr/bin/jq -ARG JQ_VERSION=1.6 -ARG JQ_SHA512=c9e585368bcb89d4c5213a31866e9301f03fe27165afcb4a3cdf0ec1be43b0fb7439d71dd9607ccc002622915b40389ee79c67d4c3c54ff95257cb23643b0330 - -USER root -RUN set -x; curl -sSLo "${JQ_PATH}" https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 && \ - [ "$(sha512sum "${JQ_PATH}" | awk '{print $1}')" = "${JQ_SHA512}" ] || exit 1 && \ - chmod +x "${JQ_PATH}" - -USER elasticsearch -RUN elasticsearch-plugin install --batch repository-s3 \ No newline at end of file diff --git a/elasticsearch-s3/build.sh b/elasticsearch-s3/build.sh index f631c419..a0d13a99 100644 --- a/elasticsearch-s3/build.sh +++ b/elasticsearch-s3/build.sh @@ -5,10 +5,10 @@ SCRIPT_DIR=`dirname ${SCRIPT}` cd ${SCRIPT_DIR}/.. IMAGE="elasticsearch-s3" -VERSION=${VERSION:-latest} -DISTRO=${DISTRO:-centos_7} +VERSION=${VERSION:-8.13.4} +MAJOR_VERSION=${MAJOR_VERSION:-8} REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""} -docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} +docker build -f ${IMAGE}/Dockerfile.${MAJOR_VERSION} --network=host --build-arg="ELASTICSEARCH_VERSION=${VERSION}" -t ${REGISTRY_URI}${IMAGE}:${VERSION}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} cd - diff --git a/zuul.d/elasticsearch-s3.yaml b/zuul.d/elasticsearch-s3.yaml index 8cdec1b7..d59ac876 100644 --- a/zuul.d/elasticsearch-s3.yaml +++ b/zuul.d/elasticsearch-s3.yaml @@ -37,34 +37,21 @@ docker_images: - context: elasticsearch-s3 repository: openstackhelm/elasticsearch-s3 - dockerfile: Dockerfile.5_6_4 + dockerfile: Dockerfile.7 + build_args: + - "ELASTICSEARCH_VERSION=7.17.21" tags: - - latest-5_6_4 - - "5_6_4-{{ currentdate }}" + - latest-7.17.21 + - "7.17.21-{{ currentdate }}" + - context: elasticsearch-s3 repository: openstackhelm/elasticsearch-s3 - dockerfile: Dockerfile.7_1_0 + dockerfile: Dockerfile.8 + build_args: + - "ELASTICSEARCH_VERSION=8.13.4" tags: - - latest-7_1_0 - - "7_1_0-{{ currentdate }}" - - context: elasticsearch-s3 - repository: openstackhelm/elasticsearch-s3 - dockerfile: Dockerfile.7_6_2 - tags: - - latest-7_6_2 - - "7_6_2-{{ currentdate }}" - - context: elasticsearch-s3 - repository: openstackhelm/elasticsearch-s3 - dockerfile: Dockerfile.8_7_1 - tags: - - latest-8_7_1 - - "8_7_1-{{ currentdate }}" - - context: elasticsearch-s3 - repository: openstackhelm/elasticsearch-s3 - dockerfile: Dockerfile.8_9_0 - tags: - - latest-8_9_0 - - "8_9_0-{{ currentdate }}" + - latest-8.13.4 + - "8.13.4-{{ currentdate }}" files: &elasticsearch-s3_files - elasticsearch-s3/.* - zuul.d/elasticsearch-s3.yaml