From abab50faf969b6afe0ed5ba0adeb0803ff517d61 Mon Sep 17 00:00:00 2001 From: Sascha Nowak Date: Thu, 16 May 2024 07:22:28 +0200 Subject: [PATCH] feature: add solr 9.5 and remove 9.3 as there are no updates anymore --- .github/workflows/docker.yml | 2 +- solr/{9.3.dockerfile => 8.Dockerfile} | 26 +++++++------- solr/Dockerfile | 51 ++++++++++++++++----------- 3 files changed, 44 insertions(+), 35 deletions(-) rename solr/{9.3.dockerfile => 8.Dockerfile} (57%) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cdcac6e..80470c2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -88,7 +88,7 @@ jobs: context: ./solr target: '' version: '' - file: 9.3.dockerfile + file: 8.Dockerfile build-args: '' - name: varnish context: ./varnish diff --git a/solr/9.3.dockerfile b/solr/8.Dockerfile similarity index 57% rename from solr/9.3.dockerfile rename to solr/8.Dockerfile index c8564b2..a5ccac7 100644 --- a/solr/9.3.dockerfile +++ b/solr/8.Dockerfile @@ -1,24 +1,23 @@ # syntax=docker/dockerfile:1 -FROM solr:9.3.0 as builder +FROM solr:8.11.3 as builder -ENV TYPO3_SOLR=12.0.0 \ - TYPO3_SOLR_DOWNLOAD_SHA512="3bcf68ff22ad58c5ad58aac7d7569823ee53e9d42513592e43e1c295a8ed7c7cd8970506508f1702386321c62dc718e28a6957cceafa0509308fed8233d83d22" +ENV TYPO3_SOLR=11.5.0 \ + TYPO3_SOLR_DOWNLOAD_SHA512="a0c0181993606dbaa587520e8aa8988f1b0eb845215828cf31df0dc181497ab4932db03359bc89655366197247210b4a82cbba1b7bcc5abba85545811e17eefe" USER root - -RUN apt-get update && \ - apt-get -y install wget tar && \ - SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/archive/${TYPO3_SOLR}.tar.gz" && \ - wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.tar.gz" && \ - echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.tar.gz" | sha512sum -c - && \ - mkdir -p /tmp/solr && \ - tar -zxvf /tmp/solr.tar.gz -C /tmp/solr --strip-components=1; +RUN set -ex; \ + apt-get update; \ + apt-get -y install wget unzip; \ + SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/releases/download/$TYPO3_SOLR/solr_$TYPO3_SOLR.zip"; \ + wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.zip"; \ + echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.zip" | sha512sum -c -; \ + unzip /tmp/solr.zip -d /tmp/solr; RUN sed -i "s|name=core_|name=website-|i" /tmp/solr/Resources/Private/Solr/cores/*/core.properties \ - && cd /tmp/solr/Resources/Private/Solr/configsets/ext_solr_12_0_0/conf \ + && cd /tmp/solr/Resources/Private/Solr/configsets/ext_solr_11_5_0/conf \ && for f in _schema_analysis_*_core_*.json; do mv "$f" "$(echo "$f" | sed s/core_/website-/)"; done -FROM solr:9.3.0 +FROM solr:8.11.3 ENV SOLR_LOG_LEVEL=WARN \ SOLR_PORT=8983 \ @@ -32,3 +31,4 @@ COPY --from=builder --chown=solr:solr /tmp/solr/Resources/Private/Solr /var/solr RUN mkdir -p /var/solr/data/data HEALTHCHECK --interval=2s --timeout=20s --retries=10 CMD curl -s -A 'healthcheck' http://localhost:$SOLR_PORT/solr/$HEALTHCHECK_CORE/admin/ping?wt=json | grep -q '"status":"OK"' + diff --git a/solr/Dockerfile b/solr/Dockerfile index 8cdbe4b..e755b0b 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,34 +1,43 @@ # syntax=docker/dockerfile:1 -FROM solr:8.11.2 as builder +FROM solr:9.5.0 as builder -ENV TYPO3_SOLR=11.5.0 \ - TYPO3_SOLR_DOWNLOAD_SHA512="a0c0181993606dbaa587520e8aa8988f1b0eb845215828cf31df0dc181497ab4932db03359bc89655366197247210b4a82cbba1b7bcc5abba85545811e17eefe" +ENV TYPO3_SOLR=12.0.3 \ + TYPO3_SOLR_DOWNLOAD_SHA512="882f24a44d221f5d85a2066ab1235c9aedcd31c8a8f2009f9343b73de2931fd354fed6a8175fe18fa6fa0c284dd07d428c4f547f24875129e5a1d57c5ffd283f" USER root -RUN set -ex; \ - apt-get update; \ - apt-get -y install wget unzip; \ - SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/releases/download/$TYPO3_SOLR/solr_$TYPO3_SOLR.zip"; \ - wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.zip"; \ - echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.zip" | sha512sum -c -; \ - unzip /tmp/solr.zip -d /tmp/solr; -RUN sed -i "s|name=core_|name=website-|i" /tmp/solr/Resources/Private/Solr/cores/*/core.properties \ - && cd /tmp/solr/Resources/Private/Solr/configsets/ext_solr_11_5_0/conf \ - && for f in _schema_analysis_*_core_*.json; do mv "$f" "$(echo "$f" | sed s/core_/website-/)"; done - -FROM solr:8.11.2 - -ENV SOLR_LOG_LEVEL=WARN \ +RUN apt-get update && \ + apt-get -y install wget tar && \ + SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/archive/${TYPO3_SOLR}.tar.gz" && \ + wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.tar.gz" && \ + sha512sum /tmp/solr.tar.gz && \ + echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.tar.gz" | sha512sum -c - && \ + mkdir -p /tmp/solr && \ + tar -zxvf /tmp/solr.tar.gz -C /tmp/solr --strip-components=1; + +FROM solr:9.5.0 +ENV TERM=linux \ + SOLR_LOG_LEVEL=WARN \ SOLR_PORT=8983 \ - HEALTHCHECK_CORE=website-generic + HEALTHCHECK_CORE=core_generic + +ARG SOLR_UNIX_UID="8983" +ARG SOLR_UNIX_GID="8983" USER root -RUN rm -fR /opt/solr/server/solr/* +RUN rm -fR /opt/solr/server/solr/* \ + && usermod --non-unique --uid "${SOLR_UNIX_UID}" solr \ + && groupmod --non-unique --gid "${SOLR_UNIX_GID}" solr \ + && chown -R solr:solr /var/solr /opt/solr \ + && apt update && apt upgrade -y && apt install sudo -y \ + && echo "# EXT:solr relevant changes: " >> /etc/default/solr.in.sh \ + && echo "SOLR_ENABLE_REMOTE_STREAMING=true" >> /etc/default/solr.in.sh \ + && echo "SOLR_ENABLE_STREAM_BODY=true" >> /etc/default/solr.in.sh \ + && echo "# END: EXT:solr" >> /etc/default/solr.in.sh + USER solr -COPY --from=builder --chown=solr:solr /tmp/solr/Resources/Private/Solr /var/solr/data +COPY --from=builder --chown=solr:solr /tmp/solr/Resources/Private/Solr/ /var/solr/data RUN mkdir -p /var/solr/data/data HEALTHCHECK --interval=2s --timeout=20s --retries=10 CMD curl -s -A 'healthcheck' http://localhost:$SOLR_PORT/solr/$HEALTHCHECK_CORE/admin/ping?wt=json | grep -q '"status":"OK"' -