You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sdap.apache.org by GitBox <gi...@apache.org> on 2018/09/06 15:46:12 UTC

[GitHub] fgreg closed pull request #19: SDAP-109 Upgrade Solr server to version 7

fgreg closed pull request #19: SDAP-109 Upgrade Solr server to version 7
URL: https://github.com/apache/incubator-sdap-nexus/pull/19
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docker/solr-single-node/Dockerfile b/docker/solr-single-node/Dockerfile
index 49ab50d..c78866a 100644
--- a/docker/solr-single-node/Dockerfile
+++ b/docker/solr-single-node/Dockerfile
@@ -19,12 +19,10 @@ MAINTAINER Apache SDAP "dev@sdap.apache.org"
 
 USER root
 
-RUN apt-get update && apt-get -y install git && rm -rf /var/lib/apt/lists/*
+COPY create-core.sh /docker-entrypoint-initdb.d/create-core.sh
+RUN chown ${SOLR_USER}:${SOLR_GROUP} /docker-entrypoint-initdb.d/create-core.sh
 
-RUN cd / && git clone https://github.com/apache/incubator-sdap-nexus.git && cp -r /incubator-sdap-nexus/data-access/config/schemas/solr/nexustiles . && rm -rf /incubator-sdap-nexus
+USER ${SOLR_USER}
+VOLUME ${SOLR_HOME}/nexustiles
 
-USER $SOLR_USER
-
-RUN cp -r /nexustiles /opt/solr/server/solr/.
-
-VOLUME ["/opt/solr/server/solr/nexustiles/data"]
+ENTRYPOINT ["solr-foreground"]
diff --git a/docker/solr-single-node/README.md b/docker/solr-single-node/README.md
index 91df066..97043a4 100644
--- a/docker/solr-single-node/README.md
+++ b/docker/solr-single-node/README.md
@@ -1,9 +1,10 @@
 
 
-This Docker container runs Apache Solr v6.4.1 as a single node with nexustiles collection.
+This Docker container runs Apache Solr v7.4 as a single node with nexustiles collection.
 
 The easiest way to run it is:
 
-    docker run --net=host --name nexus-solr -v /home/nexus/solr/data:/opt/solr/server/solr/nexustiles/data -d nexusjpl/nexus-solr-single-node
+    export SOLR_HOME=/opt/solr/server/solr/
+    docker run -it --name solr -e SOLR_HOME=${SOLR_HOME}-v /home/nexus/solr/data:${SOLR_HOME}/nexustiles sdap/solr-singlenode:${VERSION}
 
 /home/nexus/solr/data is directory on host machine where index files will be written to.
diff --git a/docker/solr-single-node/create-core.sh b/docker/solr-single-node/create-core.sh
new file mode 100755
index 0000000..49a0daa
--- /dev/null
+++ b/docker/solr-single-node/create-core.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -ex
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+SOLR_HOME=${SOLR_HOME:=/opt/solr/server/solr/}
+mkdir -p ${SOLR_HOME}/nexustiles
+cp -r /tmp/nexustiles/* ${SOLR_HOME}/nexustiles/
+chown -R ${SOLR_USER}:${SOLR_GROUP} ${SOLR_HOME}/nexustiles
+
+set +x
diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile
index 29ab29b..3fd96f7 100644
--- a/docker/solr/Dockerfile
+++ b/docker/solr/Dockerfile
@@ -12,26 +12,23 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-FROM solr:6.4.2
+FROM solr:7.4
 MAINTAINER Apache SDAP "dev@sdap.apache.org"
 
 USER root
 
-RUN cd / && wget https://downloads.sourceforge.net/project/jts-topo-suite/jts/1.14/jts-1.14.zip && unzip jts-1.14.zip -d /jts-1.14 && rm jts-1.14.zip
-
-RUN apt-get update && apt-get -y install git && rm -rf /var/lib/apt/lists/*
-
-RUN cd / && git clone https://github.com/apache/incubator-sdap-nexus.git && cp -r /incubator-sdap-nexus/data-access/config/schemas/solr/nexustiles /tmp/nexustiles && rm -rf /incubator-sdap-nexus
-
-RUN mkdir /solr-home
-
-RUN chown -R $SOLR_USER:$SOLR_USER /solr-home
-
-VOLUME /solr-home
-
-VOLUME /opt/solr/server/solr/
-RUN chown -R $SOLR_USER:$SOLR_USER /opt/solr/server/solr/
-
-RUN cp /jts-1.14/lib/jts-1.14.jar /opt/solr/server/lib/jts-1.14.jar
-
-RUN cp /jts-1.14/lib/jtsio-1.14.jar /opt/solr/server/lib/jtsio-1.14.jar
+ENV SOLR_HOME=/opt/solr/server/solr/
+
+RUN cd / && \
+    apt-get update && \
+    apt-get -y install git && \
+    rm -rf /var/lib/apt/lists/* && \
+    git clone https://github.com/apache/incubator-sdap-nexus.git && \
+    cp -r /incubator-sdap-nexus/data-access/config/schemas/solr/nexustiles /tmp/nexustiles && \
+    rm -rf /incubator-sdap-nexus && \
+    wget http://central.maven.org/maven2/org/locationtech/jts/jts-core/1.15.0/jts-core-1.15.0.jar && \
+    cp jts-core-1.15.0.jar /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/jts-core-1.15.0.jar && \
+    chown ${SOLR_USER}:${SOLR_GROUP} /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/jts-core-1.15.0.jar && \
+    rm jts-core-1.15.0.jar
+
+USER ${SOLR_USER}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services