You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/05/11 21:45:29 UTC

[GitHub] [solr-docker] HoustonPutman opened a new pull request, #4: Fix the GitFetch for the apache/solr-docker repo

HoustonPutman opened a new pull request, #4:
URL: https://github.com/apache/solr-docker/pull/4

   Merge after https://github.com/docker-library/official-images/pull/12406 is merged, adding any more changes here as needed.
   
   After this is merged, immediately delete the auto-created PR that will be made in https://github.com/docker-library/official-images, as this is just mirroring the changes already made in the PR above.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] HoustonPutman merged pull request #4: SOLR-16196: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
HoustonPutman merged PR #4:
URL: https://github.com/apache/solr-docker/pull/4


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] HoustonPutman commented on a diff in pull request #4: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on code in PR #4:
URL: https://github.com/apache/solr-docker/pull/4#discussion_r872729501


##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \
+    # Export the keys explicitly mentioned in the Dockerfile
+    gpg --export ${SOLR_KEYS} > SAVED_KEYS; \
+    # Start from scratch
+    gpg --list-keys --with-colons \
+      | awk -F: '$1 == "pub" && ($2 == "e" || $2 == "r") { print $5 }' \
+      | xargs gpg --batch --yes --delete-keys; \
+    # Re-import the keys that we saved \
+    gpg --import SAVED_KEYS; \
+    rm SAVED_KEYS; \

Review Comment:
   I tried that, it doesn't filter the keys though, it just removes the user-id information for keys that aren't jan's. So all Solr keys will still be there, they just won't have names.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] madrob commented on a diff in pull request #4: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
madrob commented on code in PR #4:
URL: https://github.com/apache/solr-docker/pull/4#discussion_r872656853


##########
9.0/Dockerfile:
##########
@@ -131,6 +134,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; \

Review Comment:
   We already installed `dirmngr` above, I think?



##########
9.0/Dockerfile:
##########
@@ -87,22 +92,14 @@ RUN set -ex; \
   tar -C /opt --extract --preserve-permissions --file "/opt/solr-$SOLR_VERSION.tgz"; \
   rm "/opt/solr-$SOLR_VERSION.tgz"*;
 
-
-
-# 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="9.0.0"

Review Comment:
   We have to update this manually each time?



##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \

Review Comment:
   You can use an in-place fd, or even pipe `wget | gpg` and it should read from stdin instead of needing to keep an extra file
   
   ```suggestion
       gpg \
         --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
         --import <(wget -nv "https://downloads.apache.org/solr/KEYS" -O-); \
   ```



##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \
+    # Export the keys explicitly mentioned in the Dockerfile
+    gpg --export ${SOLR_KEYS} > SAVED_KEYS; \
+    # Start from scratch
+    gpg --list-keys --with-colons \
+      | awk -F: '$1 == "pub" && ($2 == "e" || $2 == "r") { print $5 }' \
+      | xargs gpg --batch --yes --delete-keys; \
+    # Re-import the keys that we saved \
+    gpg --import SAVED_KEYS; \
+    rm SAVED_KEYS; \

Review Comment:
   This is so awkward... I'm looking into whether there's an easier way. There should be.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] madrob commented on a diff in pull request #4: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
madrob commented on code in PR #4:
URL: https://github.com/apache/solr-docker/pull/4#discussion_r872725869


##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \
+    # Export the keys explicitly mentioned in the Dockerfile
+    gpg --export ${SOLR_KEYS} > SAVED_KEYS; \
+    # Start from scratch
+    gpg --list-keys --with-colons \
+      | awk -F: '$1 == "pub" && ($2 == "e" || $2 == "r") { print $5 }' \
+      | xargs gpg --batch --yes --delete-keys; \
+    # Re-import the keys that we saved \
+    gpg --import SAVED_KEYS; \
+    rm SAVED_KEYS; \

Review Comment:
   We could do `--import-filter keep-uid="uid =~ Jan"` and then validate that the key with the expected fingerprint exists afterward. That lets us skip the import/export dance, but we'd need to change it each time for each release.
   
   Still trying to figure out if we can filter on the key itself.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] tianon commented on pull request #4: SOLR-16196: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
tianon commented on PR #4:
URL: https://github.com/apache/solr-docker/pull/4#issuecomment-1126548877

   All the `gpg` invocations ought to have `--batch` on them (the way it's been explained to me in the past by GnuPG developers is that it switches GnuPG from "UI / UX mode" into "API mode"), but otherwise this looks OK to me. :+1:


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] HoustonPutman commented on pull request #4: SOLR-16196: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on PR #4:
URL: https://github.com/apache/solr-docker/pull/4#issuecomment-1126552551

   Thanks for the review @tianon !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] HoustonPutman commented on a diff in pull request #4: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on code in PR #4:
URL: https://github.com/apache/solr-docker/pull/4#discussion_r872703859


##########
9.0/Dockerfile:
##########
@@ -131,6 +134,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; \

Review Comment:
   This will eventually be auto-generated by `gradle createDockerfileOfficial`. We need this to work with the local dockerfile as well, which will not be installing `dirmngr` above.



##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \

Review Comment:
   Going to do the pipe, it was throwing errors at me for this.



##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \
+    # Export the keys explicitly mentioned in the Dockerfile
+    gpg --export ${SOLR_KEYS} > SAVED_KEYS; \
+    # Start from scratch
+    gpg --list-keys --with-colons \
+      | awk -F: '$1 == "pub" && ($2 == "e" || $2 == "r") { print $5 }' \
+      | xargs gpg --batch --yes --delete-keys; \
+    # Re-import the keys that we saved \
+    gpg --import SAVED_KEYS; \
+    rm SAVED_KEYS; \

Review Comment:
   Was thinking of skipping this and figuring out a way to just accept the given key when validation below, but can't find a way to do that either.



##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \
+    # Export the keys explicitly mentioned in the Dockerfile
+    gpg --export ${SOLR_KEYS} > SAVED_KEYS; \
+    # Start from scratch
+    gpg --list-keys --with-colons \
+      | awk -F: '$1 == "pub" && ($2 == "e" || $2 == "r") { print $5 }' \
+      | xargs gpg --batch --yes --delete-keys; \
+    # Re-import the keys that we saved \
+    gpg --import SAVED_KEYS; \
+    rm SAVED_KEYS; \

Review Comment:
   Agree. I hate it, but I don't think there is a way to filter GPG keys on import. You can only filter user information and sub-keys.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] madrob commented on a diff in pull request #4: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
madrob commented on code in PR #4:
URL: https://github.com/apache/solr-docker/pull/4#discussion_r872742343


##########
9.0/Dockerfile:
##########
@@ -39,24 +38,30 @@ 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; \
+  if [ -n "$SOLR_KEYS" ]; then \
+    # Install all Solr GPG Keys
+    wget -nv "https://downloads.apache.org/solr/KEYS" -O "SOLR_KEYS"; \
+    gpg \
+      --key-origin 'url,https://downloads.apache.org/solr/KEYS' \
+      --import SOLR_KEYS; \
+    rm SOLR_KEYS; \
+    # Export the keys explicitly mentioned in the Dockerfile
+    gpg --export ${SOLR_KEYS} > SAVED_KEYS; \
+    # Start from scratch
+    gpg --list-keys --with-colons \
+      | awk -F: '$1 == "pub" && ($2 == "e" || $2 == "r") { print $5 }' \
+      | xargs gpg --batch --yes --delete-keys; \
+    # Re-import the keys that we saved \
+    gpg --import SAVED_KEYS; \
+    rm SAVED_KEYS; \

Review Comment:
   ```
    * Supported filter names are:
    *
    *  - keep-uid :: If the expression evaluates to true for a certain
    *                user ID packet, that packet and all it dependencies
    *                will be exported.  The expression may use these
    *                variables:
    *
    *                - uid  :: The entire user ID.
    *                - mbox :: The mail box part of the user ID.
    *                - primary :: Evaluate to true for the primary user ID.
    *
    *  - drop-subkey :: If the expression evaluates to true for a subkey
    *                packet that subkey and all it dependencies will be
    *                remove from the keyblock.  The expression may use these
    *                variables:
    *
    *                - secret   :: 1 for a secret subkey, else 0.
    *                - key_algo :: Public key algorithm id
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-docker] HoustonPutman commented on pull request #4: Fixes for 9.0 release

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on PR #4:
URL: https://github.com/apache/solr-docker/pull/4#issuecomment-1126251386

   Edited for the guidelines given in: https://github.com/docker-library/official-images/pull/12406#issuecomment-1124393213


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org