You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/05/13 22:26:52 UTC

[solr-docker] branch main updated: SOLR-16196: Fixes for 9.0.0 release (#4)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-docker.git


The following commit(s) were added to refs/heads/main by this push:
     new 5e88c72  SOLR-16196: Fixes for 9.0.0 release (#4)
5e88c72 is described below

commit 5e88c729ad0cb2423eb89e0e0c78d6948383b22d
Author: Houston Putman <ho...@apache.org>
AuthorDate: Fri May 13 18:26:48 2022 -0400

    SOLR-16196: Fixes for 9.0.0 release (#4)
    
    - Use Solr Keys file instead of GPG KeyServers
---
 9.0/Dockerfile                | 60 +++++++++++++++++++++----------------------
 generate-stackbrew-library.sh |  1 +
 old-solr-versions             |  2 ++
 3 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/9.0/Dockerfile b/9.0/Dockerfile
index 45963cd..2934959 100644
--- a/9.0/Dockerfile
+++ b/9.0/Dockerfile
@@ -17,11 +17,10 @@
 FROM eclipse-temurin:17-jre
 
 # TODO: remove things that exist solely for downstream specialization since Dockerfile.local now exists for that
-# TODO: replace 3rd party keyservers with official Apache Solr KEYS url
 
 ARG SOLR_VERSION="9.0.0"
 ARG SOLR_SHA512="383c6b6f352f2a385ece99b2b0a82e1552430aea65c6c33e5569da422138844192db4e06f58699325af55ee631694e16f836a5bbf8556f86fdeabc0cfa0533d5"
-ARG SOLR_KEYS="0D8D0B93"
+ARG SOLR_KEYS="3558857D1F5754B78C7F8B5A71A45A3D0D8D0B93"
 
 # If specified, this will override SOLR_DOWNLOAD_SERVER and all ASF mirrors. Typically used downstream for custom builds
 ARG SOLR_DOWNLOAD_URL
@@ -39,25 +38,21 @@ ARG SOLR_ARCHIVE_URL="https://archive.apache.org/dist/solr/solr/$SOLR_VERSION/so
 
 RUN set -ex; \
   apt-get update; \
-  apt-get -y install wget gpg; \
+  apt-get -y install wget gpg dirmngr; \
   rm -rf /var/lib/apt/lists/*; \
   export GNUPGHOME="/tmp/gnupg_home"; \
   mkdir -p "$GNUPGHOME"; \
   chmod 700 "$GNUPGHOME"; \
   echo "disable-ipv6" >> "$GNUPGHOME/dirmngr.conf"; \
-  for key in $SOLR_KEYS; do \
-    found=''; \
-    for server in \
-      pgp.mit.edu \
-      keyserver.ubuntu.com \
-      hkp://keyserver.ubuntu.com:80 \
-    ; do \
-      echo "  trying $server for $key"; \
-      gpg --batch --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
-      gpg --batch --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
-    done; \
-    test -z "$found" && echo >&2 "error: failed to fetch $key from several disparate servers -- network issues?" && exit 1; \
-  done; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys to start
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O- | \
+      gpg --batch --import --key-origin 'url,https://downloads.apache.org/solr/KEYS'; \
+    # Only keep the release key
+    release_keys="$(gpg --batch --export -a ${SOLR_KEYS})"; \
+    rm -rf "$GNUPGHOME"/*; \
+    echo "${release_keys}" | gpg --batch --import; \
+  fi; \
   MAX_REDIRECTS=2; \
   if [ -n "$SOLR_DOWNLOAD_URL" ]; then \
     # If a custom URL is defined, we download from non-ASF mirror URL and allow more redirects and skip GPG step
@@ -89,20 +84,14 @@ RUN set -ex; \
 
 
 
-# add symlink to /opt/solr, remove what we don't want.
-# Remove the Dockerfile because it might not represent the dockerfile that was used to generate the image.
-RUN set -ex; \
-  (cd /opt; ln -s solr-*/ solr); \
-  rm -Rf /opt/solr/docs /opt/solr/docker/Dockerfile;
-
-LABEL maintainer="The Apache Solr Project"
-LABEL url="https://solr.apache.org"
-LABEL repository="https://github.com/apache/solr"
-
-RUN set -ex; \
-    apt-get update; \
-    apt-get -y install acl dirmngr lsof procps wget netcat gosu tini jattach; \
-    rm -rf /var/lib/apt/lists/*;
+LABEL org.opencontainers.image.title="Apache Solr"
+LABEL org.opencontainers.image.description="Apache Solr is the popular, blazing-fast, open source search platform built on Apache Lucene."
+LABEL org.opencontainers.image.authors="The Apache Solr Project"
+LABEL org.opencontainers.image.url="https://solr.apache.org"
+LABEL org.opencontainers.image.source="https://github.com/apache/solr"
+LABEL org.opencontainers.image.documentation="https://solr.apache.org/guide/"
+LABEL org.opencontainers.image.version="${SOLR_VERSION}"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
 
 ENV SOLR_USER="solr" \
     SOLR_UID="8983" \
@@ -120,6 +109,12 @@ RUN set -ex; \
   groupadd -r --gid "$SOLR_GID" "$SOLR_GROUP"; \
   useradd -r --uid "$SOLR_UID" --gid "$SOLR_GID" "$SOLR_USER"
 
+# add symlink to /opt/solr, remove what we don't want.
+# Remove the Dockerfile because it might not represent the dockerfile that was used to generate the image.
+RUN set -ex; \
+  (cd /opt; ln -s solr-*/ solr); \
+  rm -Rf /opt/solr/docs /opt/solr/docker/Dockerfile;
+
 RUN set -ex; \
   mkdir -p /opt/solr/server/solr/lib /docker-entrypoint-initdb.d; \
   cp /opt/solr/bin/solr.in.sh /etc/default/solr.in.sh; \
@@ -131,6 +126,11 @@ RUN set -ex; \
   ln -s /opt/solr/modules /opt/solr/contrib; \
   ln -s /opt/solr/prometheus-exporter /opt/solr/modules/prometheus-exporter;
 
+RUN set -ex; \
+    apt-get update; \
+    apt-get -y install acl dirmngr lsof procps wget netcat gosu tini jattach; \
+    rm -rf /var/lib/apt/lists/*;
+
 VOLUME /var/solr
 EXPOSE 8983
 WORKDIR /opt/solr
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index 6195694..d025caa 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -70,6 +70,7 @@ Maintainers: The Apache Solr Project <de...@solr.apache.org> (@asfbot),
 			 Jan Høydahl (@janhoy),
 			 Houston Putman (@houstonputman)
 GitRepo: https://github.com/apache/solr-docker.git
+GitFetch: refs/heads/main
 EOH
 
 for version in "${versions[@]}"; do
diff --git a/old-solr-versions b/old-solr-versions
index b8c0a22..4eae111 100644
--- a/old-solr-versions
+++ b/old-solr-versions
@@ -2,11 +2,13 @@
 Tags: 8.11.1, 8.11, 8
 Architectures: amd64, arm64v8
 GitRepo: https://github.com/docker-solr/docker-solr.git
+GitFetch: refs/heads/master
 GitCommit: b30202ad6e336baf108c7c42222df723ba338010
 Directory: 8.11
 
 Tags: 8.11.1-slim, 8.11-slim, 8-slim
 Architectures: amd64, arm64v8
 GitRepo: https://github.com/docker-solr/docker-solr.git
+GitFetch: refs/heads/master
 GitCommit: b30202ad6e336baf108c7c42222df723ba338010
 Directory: 8.11/slim