From 6db1ab5444c09c49f5b362ddbcc49126466fe476 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 20 Feb 2024 16:35:54 +0000 Subject: [PATCH 1/3] Upgrade Solr Docker base image version to 9.5.0 The main addition for deployment is that `SOLR_*` environment variables will now be resolved by Solr to set the corresponding system properties, it makes using `environment` in Docker Compose files even more powerful. References: * https://solr.apache.org/guide/solr/9_5/upgrade-notes/major-changes-in-solr-9.html#solr-9-5 * https://solr.apache.org/guide/solr/9_5/deployment-guide/solr-in-docker.html#solr-in-sh-configuration * https://github.com/metabrainz/musicbrainz-docker/tree/v-2024-02-16?tab=readme-ov-file#advanced-configuration --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 68662c0..d55e869 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG MAVEN_TAG=3.9.6-eclipse-temurin-17 ARG SOLR_NAME=solr -ARG SOLR_TAG=9.4.0-slim +ARG SOLR_TAG=9.5.0-slim FROM maven:${MAVEN_TAG} AS builder From 7b512df0624044c4ec7b9a64ade159ebd280cf1a Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 20 Feb 2024 16:35:54 +0000 Subject: [PATCH 2/3] Upgrade dependencies in Maven to match Solr 9.5.0 Reference: https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html#solr-9-5 --- mb-solr/pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mb-solr/pom.xml b/mb-solr/pom.xml index ce76290..06165c4 100644 --- a/mb-solr/pom.xml +++ b/mb-solr/pom.xml @@ -37,7 +37,7 @@ org.apache.solr solr-core - 9.0.0 + 9.5.0 provided @@ -48,12 +48,12 @@ org.apache.lucene lucene-analysis-icu - 9.0.0 + 9.9.2 org.apache.solr solr-analysis-extras - 9.0.0 + 9.5.0 provided @@ -80,19 +80,19 @@ org.apache.lucene lucene-test-framework - 9.0.0 + 9.9.2 test org.apache.solr solr-test-framework - 9.0.0 + 9.5.0 test org.apache.lucene lucene-core - 9.0.0 + 9.9.2 provided From e27f3411a3587f829ec05cc344c1464b9749d2a1 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 9 Apr 2024 13:31:39 +0200 Subject: [PATCH 3/3] Prevent innocuous but annoying warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting from Solr 9.5.0, the following innocuous but annoying warning started to show up on server startup and when loading each core: java.lang.NoClassDefFoundError: jakarta/activation/DataSource It hasn’t been determined exactly why, but it is likely related to the changes made to resolve https://issues.apache.org/jira/browse/SOLR-17089 --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index d55e869..60fa01d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,10 @@ RUN --mount=type=cache,target=/root/.m2 \ cd ../mb-solr && \ mvn package -DskipTests +RUN --mount=type=cache,target=/root/.m2 \ + mvn dependency:get -Dartifact=jakarta.activation:jakarta.activation-api:2.1.3 && \ + cp -a /root/.m2/repository/jakarta/activation/jakarta.activation-api/2.1.3/jakarta.activation-api-2.1.3.jar . + FROM ${SOLR_NAME}:${SOLR_TAG} ARG SOLR_TAG @@ -40,6 +44,10 @@ RUN apt-get update && \ && \ rm -rf /var/lib/apt/lists/* +COPY --from=builder --chown=root:root \ + jakarta.activation-api-2.1.3.jar \ + /opt/solr/server/lib/ext + COPY --from=builder --chown=solr:solr \ mb-solr/target/mb-solr-0.0.1-SNAPSHOT-jar-with-dependencies.jar \ /opt/solr/lib/