From d1f22d1c933fa5d2e0b4ceb1ef4b71a76dfc6a48 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 7 Dec 2023 16:45:18 +0100 Subject: [PATCH] Upgrade solr to 9.4.0 --- solr/Dockerfile | 8 ++++---- solr/README.md | 42 +++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/solr/Dockerfile b/solr/Dockerfile index 5307aac0..deb1deff 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -2,10 +2,10 @@ FROM java ARG TARGETARCH -ARG SOLR_VERSION="8.11.2" -ARG SOLR_FILE="solr-${SOLR_VERSION}.tgz" -ARG SOLR_URL="https://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/${SOLR_FILE}" -ARG SOLR_FILE_SHA256="54d6ebd392942f0798a60d50a910e26794b2c344ee97c2d9b50e678a7066d3a6" +ARG SOLR_VERSION=9.4.0 +ARG SOLR_FILE=solr-${SOLR_VERSION}.tgz +ARG SOLR_URL=https://archive.apache.org/dist/solr/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz +ARG SOLR_FILE_SHA256=5ff28fe3a9d92804d53c0072a8459bb1d0c280e212a288a9efd31f923fe1a9d4 EXPOSE 8983 diff --git a/solr/README.md b/solr/README.md index f5eac4d5..5cf0e6c7 100644 --- a/solr/README.md +++ b/solr/README.md @@ -1,10 +1,10 @@ # Solr -Docker image for [Solr] version 8.11.2. +Docker image for [solr] version 9.4.0. Please refer to the [Solr Documentation] for more in-depth information. -As a quick example this will bring up an instance of [Solr], and allow you +As a quick example this will bring up an instance of [solr], and allow you to view on . ```bash @@ -42,29 +42,25 @@ additional settings, volumes, ports, etc. - [Solr Logging] -[Solr Documentation]: https://lucene.apache.org/solr/guide/7_1/ -[Solr Logging]: https://lucene.apache.org/solr/guide/7_1/configuring-logging.html -[Solr]: https://lucene.apache.org/solr/ - -## Changing versions +## Updating -There is 2 values you need to update/change the version. - -1. Solr version: found at [archive.apache.org](https://archive.apache.org/dist/lucene/solr) -1. SOLR_FILE_SHA256: sha256sum of the tgz file - -```dockerfile -ARG SOLR_VERSION="8.11.2" -ARG SOLR_FILE_SHA256="54d6ebd392942f0798a60d50a910e26794b2c344ee97c2d9b50e678a7066d3a6" -``` +You can change the version used for [solr] by modifying the build argument +`SOLR_VERSION` and `SOLR_FILE_SHA256` in the `Dockerfile`. -Go to [archive.apache.org](https://archive.apache.org/dist/lucene/solr) and find the version you want. There will be several files but the one to use have the following naming convention. - -* solr-${SOLR_VERSION}.tgz - -Download the two files and run and replace the _1.1.1_ with the version you have. +Change `SOLR_VERSION` and then generate the `SOLR_FILE_SHA256` with the following +commands: ```bash -# This outputs the value to use for $SOLR_FILE_SHA256. -sha256sum solr-1.1.1.tgz +SOLR_VERSION=$(cat solr/Dockerfile | grep -o 'SOLR_VERSION=.*' | cut -f2 -d=) +SOLR_FILE=$(cat solr/Dockerfile | grep -o 'SOLR_FILE=.*' | cut -f2 -d=) +SOLR_URL=$(cat solr/Dockerfile | grep -o 'SOLR_URL=.*' | cut -f2 -d=) +SOLR_FILE=$(eval "echo $SOLR_FILE") +SOLR_URL=$(eval "echo $SOLR_URL") +wget --quiet "${SOLR_URL}" +shasum -a 256 "${SOLR_FILE}" | cut -f1 -d' ' +rm "${SOLR_FILE}" ``` + +[Solr Documentation]: https://lucene.apache.org/solr/guide/7_1/ +[Solr Logging]: https://lucene.apache.org/solr/guide/7_1/configuring-logging.html +[solr]: https://lucene.apache.org/solr/