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

tallison pushed a commit to branch TIKA-3907
in repository https://gitbox.apache.org/repos/asf/tika-docker.git

commit 9ec2c055566cd9bf8a44d8a22c148dbb8df97082
Author: tallison <talli...@apache.org>
AuthorDate: Fri Oct 28 10:43:31 2022 -0400

    TIKA-3907 -- move binaries to /tika-bin for easier extensibility
---
 docker-compose-tika-customocr.yml     | 2 +-
 docker-compose-tika-grobid.yml        | 2 +-
 docker-compose-tika-ner.yml           | 5 +----
 full/Dockerfile                       | 5 +++--
 minimal/Dockerfile                    | 5 +++--
 sample-configs/ner/run_tika_server.sh | 4 ++--
 6 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/docker-compose-tika-customocr.yml 
b/docker-compose-tika-customocr.yml
index 712c12a..59970fe 100644
--- a/docker-compose-tika-customocr.yml
+++ b/docker-compose-tika-customocr.yml
@@ -20,7 +20,7 @@ services:
   tika:
     image: apache/tika:${TAG}-full
     # Override default so we can add configuration on classpath
-    entrypoint: [ "/bin/sh", "-c", "exec java -cp 
/customocr:/tika-server-standard-${TAG}.jar 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $$0 $$@"]
+    entrypoint: [ "/bin/sh", "-c", "exec java -cp \"/customocr:/tika-bin/*\" 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $$0 $$@"]
     # Kept command as example but could be added to entrypoint too
     command: -c /tika-config.xml
     restart: on-failure
diff --git a/docker-compose-tika-grobid.yml b/docker-compose-tika-grobid.yml
index 1fde6be..207f1bf 100644
--- a/docker-compose-tika-grobid.yml
+++ b/docker-compose-tika-grobid.yml
@@ -20,7 +20,7 @@ services:
   tika:
     image: apache/tika:${TAG}-full
     # Override default so we can add configuration on classpath
-    entrypoint: [ "/bin/sh", "-c", "exec java -cp 
/grobid:/tika-server-standard-${TAG}.jar 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $$0 $$@"]
+    entrypoint: [ "/bin/sh", "-c", "exec java -cp \"/grobid:/tika-bin/*" 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $$0 $$@"]
     # Kept command as example but could be added to entrypoint too
     command: -c /grobid/tika-config.xml
     restart: on-failure
diff --git a/docker-compose-tika-ner.yml b/docker-compose-tika-ner.yml
index 11b926b..50e896a 100644
--- a/docker-compose-tika-ner.yml
+++ b/docker-compose-tika-ner.yml
@@ -27,7 +27,4 @@ services:
     volumes:
       -  ./sample-configs/ner/:/ner/
     environment:
-      - TAG
-      - TIKA_JAR
-      - TIKA_SERVER_CLASS
-   
\ No newline at end of file
+      - TAG
\ No newline at end of file
diff --git a/full/Dockerfile b/full/Dockerfile
index 44a368e..e64907d 100644
--- a/full/Dockerfile
+++ b/full/Dockerfile
@@ -63,10 +63,11 @@ FROM dependencies as runtime
 RUN apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 ARG TIKA_VERSION
 ENV TIKA_VERSION=$TIKA_VERSION
-COPY --from=fetch_tika /tika-server-standard-${TIKA_VERSION}.jar 
/tika-server-standard-${TIKA_VERSION}.jar
+RUN mkdir /tika-bin
+COPY --from=fetch_tika /tika-server-standard-${TIKA_VERSION}.jar 
/tika-bin/tika-server-standard-${TIKA_VERSION}.jar
 USER $UID_GID
 EXPOSE 9998
-ENTRYPOINT [ "/bin/sh", "-c", "exec java -jar 
/tika-server-standard-${TIKA_VERSION}.jar -h 0.0.0.0 $0 $@"]
+ENTRYPOINT [ "/bin/sh", "-c", "exec java -cp \"/tika-bin/*\" 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $0 $@"]
 
 LABEL maintainer="Apache Tika Developers d...@tika.apache.org"
 
diff --git a/minimal/Dockerfile b/minimal/Dockerfile
index fbe09e8..408f108 100644
--- a/minimal/Dockerfile
+++ b/minimal/Dockerfile
@@ -56,9 +56,10 @@ FROM dependencies as runtime
 RUN apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 ARG TIKA_VERSION
 ENV TIKA_VERSION=$TIKA_VERSION
-COPY --from=fetch_tika /tika-server-standard-${TIKA_VERSION}.jar 
/tika-server-standard-${TIKA_VERSION}.jar
+RUN mkdir /tika-bin
+COPY --from=fetch_tika /tika-server-standard-${TIKA_VERSION}.jar 
/tika-bin/tika-server-standard-${TIKA_VERSION}.jar
 USER $UID_GID
 EXPOSE 9998
-ENTRYPOINT [ "/bin/sh", "-c", "exec java -jar 
/tika-server-standard-${TIKA_VERSION}.jar -h 0.0.0.0 $0 $@"]
+ENTRYPOINT [ "/bin/sh", "-c", "exec java -cp \"/tika-bin/*\" 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $0 $@"]
 
 LABEL maintainer="Apache Tika Developers d...@tika.apache.org"
diff --git a/sample-configs/ner/run_tika_server.sh 
b/sample-configs/ner/run_tika_server.sh
index 5e2c2d5..110c897 100755
--- a/sample-configs/ner/run_tika_server.sh
+++ b/sample-configs/ner/run_tika_server.sh
@@ -57,6 +57,6 @@ echo 
"EMAIL=(?:[a-z0-9!#$%&'*+/=?^_\`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*
 # Can be a single implementation or comma seperated list for multiple for 
"ner.impl.class" property
 
RECOGNISERS=org.apache.tika.parser.ner.opennlp.OpenNLPNERecogniser,org.apache.tika.parser.ner.regex.RegexNERecogniser
 # Set classpath to the Tika Server JAR and the /ner folder so it has the 
configuration and models from above
-CLASSPATH=/ner:/${TIKA_JAR}-${TIKA_VERSION}.jar
+CLASSPATH="/ner:/tika-bin/*"
 # Run the server with the custom configuration ner.impl.class property and 
custom /ner/tika-config.xml
-exec java -Dner.impl.class=$RECOGNISERS -cp $CLASSPATH ${TIKA_SERVER_CLASS} -h 
0.0.0.0 -c /ner/tika-config.xml
\ No newline at end of file
+exec java -Dner.impl.class=$RECOGNISERS -cp $CLASSPATH 
org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 -c /ner/tika-config.xml
\ No newline at end of file

Reply via email to