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

fgreg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/master by this push:
     new f1ce151  SDAP-109 Upgrade Solr server to version 7 (#19)
f1ce151 is described below

commit f1ce1519f51ba7f182c54058de76ba4a6327eba5
Author: fgreg <[email protected]>
AuthorDate: Thu Sep 6 08:46:09 2018 -0700

    SDAP-109 Upgrade Solr server to version 7 (#19)
    
    * upgrade solr image
    
    * Using init db script instead of other stuff.
---
 docker/solr-single-node/Dockerfile                 | 12 ++++----
 docker/solr-single-node/README.md                  |  5 ++--
 .../{Dockerfile => create-core.sh}                 | 19 +++++-------
 docker/solr/Dockerfile                             | 35 ++++++++++------------
 4 files changed, 31 insertions(+), 40 deletions(-)

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 "[email protected]"
 
 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/Dockerfile 
b/docker/solr-single-node/create-core.sh
old mode 100644
new mode 100755
similarity index 62%
copy from docker/solr-single-node/Dockerfile
copy to docker/solr-single-node/create-core.sh
index 49ab50d..49a0daa
--- a/docker/solr-single-node/Dockerfile
+++ b/docker/solr-single-node/create-core.sh
@@ -1,3 +1,4 @@
+#!/bin/bash -ex
 
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -13,18 +14,12 @@
 # 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.
-ARG tag_version=latest
-FROM sdap/solr:${tag_version}
-MAINTAINER Apache SDAP "[email protected]"
 
-USER root
+set -ex
 
-RUN apt-get update && apt-get -y install git && rm -rf /var/lib/apt/lists/*
+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
 
-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
-
-RUN cp -r /nexustiles /opt/solr/server/solr/.
-
-VOLUME ["/opt/solr/server/solr/nexustiles/data"]
+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 "[email protected]"
 
 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}

Reply via email to