├── .gitignore
├── .env
├── sample-configs
├── grobid
│ ├── org
│ │ └── apache
│ │ │ └── tika
│ │ │ └── parser
│ │ │ └── journal
│ │ │ └── GrobidExtractor.properties
│ └── tika-config.xml
├── customocr
│ ├── org
│ │ └── apache
│ │ │ └── tika
│ │ │ └── parser
│ │ │ └── ocr
│ │ │ └── TesseractOCRConfig.properties
│ ├── tika-config-inline.xml
│ └── tika-config-rendered.xml
├── ner
│ ├── tika-config.xml
│ └── run_tika_server.sh
└── vision
│ ├── inception-rest.xml
│ ├── inception-rest-caption.xml
│ └── inception-rest-video.xml
├── .asf.yaml
├── docker-compose-tika-ner.yml
├── docker-compose-tika-grobid.yml
├── docker-compose-tika-customocr.yml
├── CHANGES.md
├── docker-compose-tika-vision.yml
├── republish-images.sh
├── minimal
└── Dockerfile
├── full
└── Dockerfile
├── docker-tool.sh
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | .svn
2 | target
3 | dependency-reduced-pom.xml
4 | .idea
5 | .classpath
6 | .project
7 | .settings
8 | *.iml
9 | *.ipr
10 | *.iws
11 | *.bin
12 | nbactions.xml
13 | nb-configuration.xml
14 | *.DS_Store
15 | *.tmp-inception
16 | *.snap
17 | .*.swp
18 | tika-deployment/tika-snap-app/parts/
19 | tika-deployment/tika-snap-app/prime/
20 | tika-deployment/tika-snap-app/snap/
21 | tika-deployment/tika-snap-app/stage/
22 | tika-deployment/tika-snap-app/test/
23 | tika-deployment/tika-snap-server/parts/
24 | tika-deployment/tika-snap-server/prime/
25 | tika-deployment/tika-snap-server/snap/
26 | tika-deployment/tika-snap-server/stage/
27 |
28 |
--------------------------------------------------------------------------------
/.env:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | TAG=3.2.3.0
--------------------------------------------------------------------------------
/sample-configs/grobid/org/apache/tika/parser/journal/GrobidExtractor.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | grobid.server.url=http://grobid:8070
--------------------------------------------------------------------------------
/.asf.yaml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # the License. You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | github:
15 | description: "Convenience Docker images for Apache Tika Server"
16 | homepage: https://tika.apache.org/
17 | labels:
18 | - docker
19 | - image
20 | - tika
21 |
22 | notifications:
23 | commits: commits@tika.apache.org
24 | issues: dev@tika.apache.org
25 | pullrequests: dev@tika.apache.org
26 | jira_options: link label comment
27 |
--------------------------------------------------------------------------------
/sample-configs/customocr/org/apache/tika/parser/ocr/TesseractOCRConfig.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # You customise or add the settings you want here
17 | language=eng+spa+fra+deu+ita
18 | timeout=240
19 | minFileSizeToOcr=1
20 | enableImageProcessing=0
21 | density=200
22 | depth=8
23 | filter=box
24 | resize=300
25 | applyRotation=true
--------------------------------------------------------------------------------
/sample-configs/grobid/tika-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | application/pdf
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docker-compose-tika-ner.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | version: "3.8"
17 | services:
18 |
19 | ## Apache Tika Server
20 | tika:
21 | image: apache/tika:${TAG}-full
22 | # Use custom script as entrypoint to go fetch models and setup recognisers
23 | entrypoint: [ "/ner/run_tika_server.sh"]
24 | restart: on-failure
25 | ports:
26 | - "9998:9998"
27 | volumes:
28 | - ./sample-configs/ner/:/ner/
29 | environment:
30 | - TAG
--------------------------------------------------------------------------------
/sample-configs/ner/tika-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | application/pdf
22 | text/plain
23 | text/html
24 | application/xhtml+xml
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/sample-configs/customocr/tika-config-inline.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | true
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/docker-compose-tika-grobid.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | version: "3.8"
17 | services:
18 |
19 | ## Apache Tika Server
20 | tika:
21 | image: apache/tika:${TAG}-full
22 | # Override default so we can add configuration on classpath
23 | entrypoint: [ "/bin/sh", "-c", "exec java -cp \"/grobid:/tika-server-standard-$${TIKA_VERSION}.jar:/tika-extras/*\" org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $$0 $$@"]
24 | # Kept command as example but could be added to entrypoint too
25 | command: -c /grobid/tika-config.xml
26 | restart: on-failure
27 | ports:
28 | - "9998:9998"
29 | volumes:
30 | - ./sample-configs/grobid:/grobid
31 | depends_on:
32 | - grobid
33 |
34 | ## Grobid Service
35 | grobid:
36 | image: lfoppiano/grobid:0.6.1
37 | ports:
38 | - "8070:8070"
39 | - "8071:8071"
40 |
41 |
--------------------------------------------------------------------------------
/sample-configs/vision/inception-rest.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | image/jpeg
22 | image/png
23 | image/gif
24 |
25 | http://inception-rest:8764/inception/v4
26 | 2
27 | 0.015
28 | org.apache.tika.parser.recognition.tf.TensorflowRESTRecogniser
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/sample-configs/vision/inception-rest-caption.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | image/jpeg
22 | image/png
23 | image/gif
24 |
25 | http://inception-caption:8764/inception/v3
26 | 5
27 | 15
28 | org.apache.tika.parser.captioning.tf.TensorflowRESTCaptioner
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/docker-compose-tika-customocr.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | version: "3.8"
17 | services:
18 |
19 | ## Apache Tika Server
20 | tika:
21 | image: apache/tika:${TAG}-full
22 | # Override default so we can add configuration on classpath
23 | entrypoint: [ "/bin/sh", "-c", "exec java -cp \"/customocr:/tika-server-standard-$${TIKA_VERSION}.jar:/tika-extras/*\" org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $$0 $$@"]
24 | # Kept command as example but could be added to entrypoint too
25 | command: -c /tika-config.xml
26 | restart: on-failure
27 | ports:
28 | - "9998:9998"
29 | volumes:
30 | # Choose the configuration you want, or add your own custom one
31 | # - ./sample-configs/customocr/tika-config-inline.xml:/tika-config.xml
32 | - ./sample-configs/customocr/tika-config-rendered.xml:/tika-config.xml
33 |
34 |
35 |
--------------------------------------------------------------------------------
/sample-configs/vision/inception-rest-video.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | video/mp4
22 | video/quicktime
23 |
24 | http://inception-video:8764/inception/v4
25 | 4
26 | 0.015
27 | fixed
28 | org.apache.tika.parser.recognition.tf.TensorflowRESTVideoRecogniser
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/sample-configs/customocr/tika-config-rendered.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
31 | ocr_only
32 | rgb
33 | 100
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/CHANGES.md:
--------------------------------------------------------------------------------
1 | # Changes
2 |
3 | As of 2.5.0.1, we started adding a digit for Docker versions. Going forward, we'll include
4 | a four digit version, where the first three are the Tika version and the last one is the docker version.
5 | As of 2.5.0.2, we started tagging release commits in our github repo.
6 |
7 | * 3.2.3.0 (15 Sep 2025)
8 | * First 3.2.3 release
9 |
10 | * 3.2.2.0 (8 Aug 2025)
11 | * First 3.2.2 release
12 |
13 | * 3.2.1.0 (9 Jul 2025)
14 | * First 3.2.1 release
15 |
16 | * 3.2.0.0 (2 Jun 2025)
17 | * First 3.2.0 release
18 | * Update base to plucky
19 | * Add Japanese language pack for tesseract
20 | * Add ImageMagick
21 |
22 | * 3.1.0.0 (31 Jan 2025)
23 | * First 3.1.0 release
24 | * Update base to oracular
25 |
26 | * 3.0.0.0 (21 Oct 2024)
27 | * First 3.x stable release
28 | * Bump jre to 21
29 |
30 | * 2.9.2.1 (21 May 2024)
31 | * Updated to noble
32 | * First multi-arch release
33 |
34 | * 2.9.2.0 (10 October 2023)
35 | * Initial release for Tika 2.9.2
36 |
37 | * 2.9.1.0 (10 October 2023)
38 | * Initial release for Tika 2.9.1
39 |
40 | * 2.9.0.0 (28 August 2023)
41 | * Initial release for Tika 2.9.0
42 |
43 | * 2.8.0.0 (15 May 2023)
44 | * Initial release for Tika 2.8.0
45 |
46 |
47 | * 2.7.0.1 (27 March 2023)
48 | * More efficient build process and final image size via @stumpylog on [pr#17](https://github.com/apache/tika-docker/pull).
49 |
50 | * 2.7.0.0 (6 Feb 2023)
51 | * Initial release for Tika 2.7.0
52 |
53 | * 2.6.0.1 (10 November 2022)
54 | * Update operating system against OpenSSL CVE (TIKA-3926).
55 |
56 | * 2.6.0.0 (7 November 2022)
57 | * Initial release for Tika 2.6.0
58 |
59 | * 2.5.0.2 (31 October 2022)
60 | * Fixed root-user regression caused by differences in Docker behavior based on the build system's OS (TIKA-3912)
61 | * Added tika-extras/ directory to pick up extra jars via mounted drive or for those using our image as a base image (TIKA-3907)
62 | *
63 | * 2.5.0.1 (27 October 2022)
64 | * Update to latest jammy to avoid recent CVEs (TIKA-3906)
--------------------------------------------------------------------------------
/docker-compose-tika-vision.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | version: "3.8"
17 | services:
18 |
19 | ## Apache Tika Server
20 | tika:
21 | image: apache/tika:latest-full
22 | command: -c /tika-config.xml
23 | restart: on-failure
24 | ports:
25 | - "9998:9998"
26 |
27 | volumes:
28 | # Replace the below with the configuration you want to use, or with your own custom one
29 | # - ./sample-configs/vision/inception-rest.xml:/tika-config.xml
30 | # - ./sample-configs/vision/inception-rest-video.xml:/tika-config.xml
31 | - ./sample-configs/vision/inception-rest-caption.xml:/tika-config.xml
32 |
33 | depends_on:
34 | # You can comment out any you don't need here and in the Vision Service section below
35 | - inception-rest
36 | - inception-caption
37 | - inception-video
38 |
39 | ## Vision Services
40 | inception-rest:
41 | build: https://raw.githubusercontent.com/dameikle/tika-dockers/patch-1/InceptionRestDockerfile
42 | ports:
43 | - "8764:8764"
44 |
45 | inception-caption:
46 | build: https://raw.githubusercontent.com/dameikle/tika-dockers/patch-1/Im2txtRestDockerfile
47 | ports:
48 | - "8765:8764"
49 |
50 | inception-video:
51 | build: https://raw.githubusercontent.com/dameikle/tika-dockers/patch-1/InceptionVideoRestDockerfile
52 | ports:
53 | - "8766:8764"
54 |
55 |
--------------------------------------------------------------------------------
/republish-images.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 |
20 |
21 | ##
22 | ## Helper script to allow a republish of all versions released so far.
23 | ## This was used to support the original seeding of the DockerHub repo
24 | ##
25 |
26 | # Early releases on JRE 8
27 | for i in {6..13};
28 | do
29 | docker build -t apache/tika:"1.$i" --build-arg TIKA_VERSION="1.$i" --build-arg JRE=openjdk-8-jre-headless - < minimal/Dockerfile
30 | docker build -t apache/tika:"1.$i"-full --build-arg TIKA_VERSION="1.$i" --build-arg JRE=openjdk-8-jre-headless - < full/Dockerfile
31 | ./docker-tool.sh test "1.$i"
32 | if [ $? -eq 0 ]
33 | then
34 | ./docker-tool.sh publish "1.$i"
35 | else
36 | echo "Failed to test and publish version ${1.$i}"
37 | echo "$(tput setaf 1)Failed to test and publish image : apache/tika:${1.$i}$(tput sgr0)"
38 | exit 1
39 | fi
40 | done;
41 |
42 | # Signing issues on these release where public key is not available
43 | for i in {14..19};
44 | do
45 | docker build -t apache/tika:"1.$i" --build-arg TIKA_VERSION="1.$i" --build-arg JRE=openjdk-8-jre-headless --build-arg CHECK_SIG=false - < minimal/Dockerfile
46 | docker build -t apache/tika:"1.$i"-full --build-arg TIKA_VERSION="1.$i" --build-arg JRE=openjdk-8-jre-headless --build-arg CHECK_SIG=false - < full/Dockerfile
47 | ./docker-tool.sh test "1.$i"
48 | if [ $? -eq 0 ]
49 | then
50 | ./docker-tool.sh publish "1.$i"
51 | else
52 | echo "Failed to test and publish version ${1.$i}"
53 | echo "$(tput setaf 1)Failed to test and publish image : apache/tika:${1.$i}$(tput sgr0)"
54 | exit 1
55 | fi
56 | done;
57 |
58 | # Moved to JRE 11 by default
59 | for i in {20..23};
60 | do
61 | ./docker-tool.sh build "1.$i"
62 | ./docker-tool.sh test "1.$i"
63 | if [ $? -eq 0 ]
64 | then
65 | ./docker-tool.sh publish "1.$i"
66 | else
67 | echo "Failed to test and publish version ${1.$i}"
68 | echo "$(tput setaf 1)Failed to test and publish image : apache/tika:${1.$i}$(tput sgr0)"
69 | exit 1
70 | fi
71 | done;
--------------------------------------------------------------------------------
/sample-configs/ner/run_tika_server.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 |
19 | #############################################################################
20 | # See https://cwiki.apache.org/confluence/display/TIKA/TikaAndNER for details
21 | # on how to configure additional NER libraries
22 | #############################################################################
23 |
24 | # ------------------------------------
25 | # Download OpenNLP Models to classpath
26 | # ------------------------------------
27 |
28 | OPENNLP_LOCATION="/ner/org/apache/tika/parser/ner/opennlp"
29 | URL="http://opennlp.sourceforge.net/models-1.5"
30 |
31 | mkdir -p $OPENNLP_LOCATION
32 | if [ "$(ls -A $OPENNLP_LOCATION/*.bin)" ]; then
33 | echo "OpenNLP models directory has files, so skipping fetch";
34 | else
35 | echo "No OpenNLP models found, so fetching them"
36 | wget "$URL/en-ner-person.bin" -O $OPENNLP_LOCATION/ner-person.bin
37 | wget "$URL/en-ner-location.bin" -O $OPENNLP_LOCATION/ner-location.bin
38 | wget "$URL/en-ner-organization.bin" -O $OPENNLP_LOCATION/ner-organization.bin;
39 | wget "$URL/en-ner-date.bin" -O $OPENNLP_LOCATION/ner-date.bin
40 | wget "$URL/en-ner-time.bin" -O $OPENNLP_LOCATION/ner-time.bin
41 | wget "$URL/en-ner-percentage.bin" -O $OPENNLP_LOCATION/ner-percentage.bin
42 | wget "$URL/en-ner-money.bin" -O $OPENNLP_LOCATION/ner-money.bin
43 | fi
44 |
45 | # --------------------------------------------
46 | # Create RexExp Example for Email on classpath
47 | # --------------------------------------------
48 | REGEXP_LOCATION="/ner/org/apache/tika/parser/ner/regex"
49 | mkdir -p $REGEXP_LOCATION
50 | echo "EMAIL=(?:[a-z0-9!#$%&'*+/=?^_\`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])" > $REGEXP_LOCATION/ner-regex.txt
51 |
52 |
53 | # -------------------
54 | # Now run Tika Server
55 | # -------------------
56 |
57 | # Can be a single implementation or comma seperated list for multiple for "ner.impl.class" property
58 | RECOGNISERS=org.apache.tika.parser.ner.opennlp.OpenNLPNERecogniser,org.apache.tika.parser.ner.regex.RegexNERecogniser
59 | # Set classpath to the Tika Server JAR and the /ner folder so it has the configuration and models from above
60 | CLASSPATH="/ner:/tika-server-standard-${TIKA_VERSION}.jar:/tika-extras/*"
61 | # Run the server with the custom configuration ner.impl.class property and custom /ner/tika-config.xml
62 | exec java -Dner.impl.class=$RECOGNISERS -cp $CLASSPATH org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 -c /ner/tika-config.xml
--------------------------------------------------------------------------------
/minimal/Dockerfile:
--------------------------------------------------------------------------------
1 |
2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | # use this file except in compliance with the License. You may obtain a copy of
4 | # the License at
5 | #
6 | # http://www.apache.org/licenses/LICENSE-2.0
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations under
12 | # the License.
13 |
14 | # "random" uid/gid hopefully not used anywhere else
15 | # This needs to be set globally and then referenced in
16 | # the subsequent stages -- see TIKA-3912
17 | ARG UID_GID="35002:35002"
18 |
19 | FROM ubuntu:plucky AS base
20 |
21 | FROM base AS fetch_tika
22 |
23 | ARG TIKA_VERSION
24 | ARG CHECK_SIG=true
25 |
26 | ENV NEAREST_TIKA_SERVER_URL="https://dlcdn.apache.org/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar" \
27 | ARCHIVE_TIKA_SERVER_URL="https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar" \
28 | BACKUP_TIKA_SERVER_URL="https://downloads.apache.org/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar" \
29 | DEFAULT_TIKA_SERVER_ASC_URL="https://downloads.apache.org/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar.asc" \
30 | ARCHIVE_TIKA_SERVER_ASC_URL="https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar.asc" \
31 | TIKA_VERSION=$TIKA_VERSION
32 |
33 | RUN set -eux \
34 | && apt-get update \
35 | && DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
36 | gnupg2 \
37 | wget \
38 | ca-certificates \
39 | && wget -t 10 --max-redirect 1 --retry-connrefused -qO- https://downloads.apache.org/tika/KEYS | gpg --import \
40 | && wget -t 10 --max-redirect 1 --retry-connrefused $NEAREST_TIKA_SERVER_URL -O /tika-server-standard-${TIKA_VERSION}.jar || rm /tika-server-standard-${TIKA_VERSION}.jar \
41 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar ]" || wget $ARCHIVE_TIKA_SERVER_URL -O /tika-server-standard-${TIKA_VERSION}.jar || rm /tika-server-standard-${TIKA_VERSION}.jar \
42 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar ]" || wget $BACKUP_TIKA_SERVER_URL -O /tika-server-standard-${TIKA_VERSION}.jar || rm /tika-server-standard-${TIKA_VERSION}.jar \
43 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar ]" || exit 1 \
44 | && wget -t 10 --max-redirect 1 --retry-connrefused $DEFAULT_TIKA_SERVER_ASC_URL -O /tika-server-standard-${TIKA_VERSION}.jar.asc || rm /tika-server-standard-${TIKA_VERSION}.jar.asc \
45 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar.asc ]" || wget $ARCHIVE_TIKA_SERVER_ASC_URL -O /tika-server-standard-${TIKA_VERSION}.jar.asc || rm /tika-server-standard-${TIKA_VERSION}.jar.asc \
46 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar.asc ]" || exit 1 \
47 | && gpg --verify /tika-server-standard-${TIKA_VERSION}.jar.asc /tika-server-standard-${TIKA_VERSION}.jar
48 |
49 | # this used to work, but I'm getting "ERROR: failed to solve: failed to prepare $data as $data2: invalid argument"
50 | # when trying to build 2.9.2.0
51 | #RUN if [ "$CHECK_SIG" = "true" ] ; then gpg --verify /tika-server-standard-${TIKA_VERSION}.jar.asc /tika-server-standard-${TIKA_VERSION}.jar; fi
52 |
53 | FROM base AS runtime
54 | # must reference uid_gid
55 | ARG UID_GID
56 | ARG JRE='openjdk-21-jre-headless'
57 | RUN set -eux \
58 | && apt-get update \
59 | && apt-get install --yes --no-install-recommends \
60 | ${JRE} \
61 | ca-certificates \
62 | && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
63 | ARG TIKA_VERSION
64 | ENV TIKA_VERSION=$TIKA_VERSION
65 | COPY --from=fetch_tika /tika-server-standard-${TIKA_VERSION}.jar /tika-server-standard-${TIKA_VERSION}.jar
66 | USER $UID_GID
67 | EXPOSE 9998
68 | ENTRYPOINT [ "/bin/sh", "-c", "exec java -cp \"/tika-server-standard-${TIKA_VERSION}.jar:/tika-extras/*\" org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $0 $@"]
69 |
70 | LABEL maintainer="Apache Tika Developers dev@tika.apache.org"
71 |
--------------------------------------------------------------------------------
/full/Dockerfile:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
2 | # use this file except in compliance with the License. You may obtain a copy of
3 | # the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations under
11 | # the License.
12 |
13 | # "random" uid/gid hopefully not used anywhere else
14 | # This needs to be set globally and then referenced in
15 | # the subsequent stages -- see TIKA-3912
16 | ARG UID_GID="35002:35002"
17 |
18 | FROM ubuntu:plucky AS base
19 |
20 | FROM base AS fetch_tika
21 |
22 | ARG TIKA_VERSION
23 | ARG CHECK_SIG=true
24 |
25 | ENV NEAREST_TIKA_SERVER_URL="https://dlcdn.apache.org/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar" \
26 | ARCHIVE_TIKA_SERVER_URL="https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar" \
27 | BACKUP_TIKA_SERVER_URL="https://downloads.apache.org/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar" \
28 | DEFAULT_TIKA_SERVER_ASC_URL="https://downloads.apache.org/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar.asc" \
29 | ARCHIVE_TIKA_SERVER_ASC_URL="https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-server-standard-${TIKA_VERSION}.jar.asc" \
30 | TIKA_VERSION=$TIKA_VERSION
31 |
32 | RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y install gnupg2 wget ca-certificates \
33 | && wget -t 10 --max-redirect 1 --retry-connrefused -qO- https://downloads.apache.org/tika/KEYS | gpg --import \
34 | && wget -t 10 --max-redirect 1 --retry-connrefused $NEAREST_TIKA_SERVER_URL -O /tika-server-standard-${TIKA_VERSION}.jar || rm /tika-server-standard-${TIKA_VERSION}.jar \
35 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar ]" || wget $ARCHIVE_TIKA_SERVER_URL -O /tika-server-standard-${TIKA_VERSION}.jar || rm /tika-server-standard-${TIKA_VERSION}.jar \
36 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar ]" || wget $BACKUP_TIKA_SERVER_URL -O /tika-server-standard-${TIKA_VERSION}.jar || rm /tika-server-standard-${TIKA_VERSION}.jar \
37 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar ]" || exit 1 \
38 | && wget -t 10 --max-redirect 1 --retry-connrefused $DEFAULT_TIKA_SERVER_ASC_URL -O /tika-server-standard-${TIKA_VERSION}.jar.asc || rm /tika-server-standard-${TIKA_VERSION}.jar.asc \
39 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar.asc ]" || wget $ARCHIVE_TIKA_SERVER_ASC_URL -O /tika-server-standard-${TIKA_VERSION}.jar.asc || rm /tika-server-standard-${TIKA_VERSION}.jar.asc \
40 | && sh -c "[ -f /tika-server-standard-${TIKA_VERSION}.jar.asc ]" || exit 1 \
41 | && gpg --verify /tika-server-standard-${TIKA_VERSION}.jar.asc /tika-server-standard-${TIKA_VERSION}.jar
42 |
43 | #RUN if [ "$CHECK_SIG" = "true" ] ; then gpg --verify /tika-server-standard-${TIKA_VERSION}.jar.asc /tika-server-standard-${TIKA_VERSION}.jar; fi
44 |
45 | FROM base AS runtime
46 | ARG UID_GID
47 | ARG JRE='openjdk-21-jre-headless'
48 | RUN set -eux \
49 | && apt-get update \
50 | && apt-get install --yes --no-install-recommends gnupg2 software-properties-common \
51 | && apt-get update \
52 | && DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends $JRE \
53 | gdal-bin \
54 | imagemagick \
55 | tesseract-ocr \
56 | tesseract-ocr-eng \
57 | tesseract-ocr-ita \
58 | tesseract-ocr-fra \
59 | tesseract-ocr-spa \
60 | tesseract-ocr-deu \
61 | tesseract-ocr-jpn \
62 | && echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections \
63 | && DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
64 | xfonts-utils \
65 | fonts-freefont-ttf \
66 | fonts-liberation \
67 | ttf-mscorefonts-installer \
68 | wget \
69 | cabextract \
70 | && apt-get clean -y \
71 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
72 | ARG TIKA_VERSION
73 | ENV TIKA_VERSION=$TIKA_VERSION
74 |
75 | COPY --from=fetch_tika /tika-server-standard-${TIKA_VERSION}.jar /tika-server-standard-${TIKA_VERSION}.jar
76 | USER $UID_GID
77 |
78 | EXPOSE 9998
79 | ENTRYPOINT [ "/bin/sh", "-c", "exec java -cp \"/tika-server-standard-${TIKA_VERSION}.jar:/tika-extras/*\" org.apache.tika.server.core.TikaServerCli -h 0.0.0.0 $0 $@"]
80 |
81 | LABEL maintainer="Apache Tika Developers dev@tika.apache.org"
82 |
83 |
--------------------------------------------------------------------------------
/docker-tool.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 |
20 | image_name=apache/tika
21 |
22 | stop_and_die() {
23 | docker buildx rm tika-builder || die "couldn't stop builder -- make sure to stop the builder manually! "
24 | die "$*"
25 | }
26 |
27 | die() {
28 | echo "$*" >&2
29 | exit 1
30 | }
31 |
32 | while getopts ":h" opt; do
33 | case ${opt} in
34 | h )
35 | echo "Usage:"
36 | echo " docker-tool.sh -h Display this help message."
37 | echo " docker-tool.sh build Builds images for ."
38 | echo " docker-tool.sh test Tests images for ."
39 | echo " docker-tool.sh publish Builds multi-arch images for and pushes to Docker Hub."
40 | exit 0
41 | ;;
42 | \? )
43 | echo "Invalid Option: -$OPTARG" 1>&2
44 | exit 1
45 | ;;
46 | esac
47 | done
48 |
49 | stop_test_container() {
50 | container_name=$1
51 | docker kill "$container_name"
52 | docker rm "$container_name"
53 | }
54 |
55 | test_docker_image() {
56 | container_name=$1
57 | image=$image_name:$1
58 | full=$2
59 |
60 | docker run -d --name "$container_name" -p 127.0.0.1:9998:9998 "$image"
61 | sleep 10
62 | url=http://localhost:9998/
63 | status=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null ${url})
64 | user=$(docker inspect "$container_name" --format '{{.Config.User}}')
65 |
66 | if [[ $status == '200' ]]
67 | then
68 | echo "$(tput setaf 2)Image: $image - Basic test passed$(tput sgr0)"
69 | else
70 | echo "$(tput setaf 1)Image: $image - Basic test failed$(tput sgr0)"
71 | stop_test_container "$container_name"
72 | exit 1
73 | fi
74 |
75 | #now test that the user is correctly set
76 | if [[ $user == '35002:35002' ]]
77 | then
78 | echo "$(tput setaf 2)Image: $image - User passed$(tput sgr0)"
79 | else
80 | echo "$(tput setaf 1)Image: $image - User failed$(tput sgr0)"
81 | stop_test_container "$container_name"
82 | exit 1
83 | fi
84 |
85 | if [ $full == true ]
86 | then
87 | # Test ImageMagick is installed and runnable
88 | if docker exec "$1" /usr/bin/convert -version >/dev/null
89 | then
90 | echo "$(tput setaf 2)Image: $image - ImageMagick passed$(tput sgr0)"
91 | else
92 | echo "$(tput setaf 1)Image: $image - ImageMagick failed$(tput sgr0)"
93 | stop_test_container "$container_name"
94 | exit 1
95 | fi
96 | fi
97 |
98 | stop_test_container "$container_name"
99 | }
100 |
101 | shift $((OPTIND -1))
102 | subcommand=$1; shift
103 | tika_docker_version=$1; shift
104 | tika_version=$1; shift
105 |
106 |
107 | case "$subcommand" in
108 | build)
109 | # Build slim tika- with minimal dependencies
110 | docker build -t ${image_name}:${tika_docker_version} --build-arg TIKA_VERSION=${tika_version} - < minimal/Dockerfile --no-cache || die "couldn't build minimal"
111 | # Build full tika- with OCR, Fonts and GDAL
112 | docker build -t ${image_name}:${tika_docker_version}-full --build-arg TIKA_VERSION=${tika_version} - < full/Dockerfile --no-cache || die "couldn't build full"
113 | ;;
114 |
115 | test)
116 | # Test the images
117 | test_docker_image ${tika_docker_version} false
118 | test_docker_image "${tika_docker_version}-full" true
119 | ;;
120 |
121 | publish)
122 | docker buildx create --use --name tika-builder || die "couldn't create builder"
123 | # Build multi-arch with buildx and push
124 | docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --output "type=image,push=true" \
125 | --tag ${image_name}:latest --tag ${image_name}:${tika_docker_version} --build-arg TIKA_VERSION=${tika_version} --no-cache --builder tika-builder minimal || stop_and_die "couldn't build multi-arch minimal"
126 | docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --output "type=image,push=true" \
127 | --tag ${image_name}:latest-full --tag ${image_name}:${tika_docker_version}-full --build-arg TIKA_VERSION=${tika_version} --no-cache --builder tika-builder full || stop_and_die "couldn't build multi-arch full"
128 | docker buildx rm tika-builder || die "couldn't stop builder -- make sure to stop the builder manually! "
129 | ;;
130 |
131 | esac
132 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # tika-docker
2 |
3 | This repo is used to create convenience Docker images for Apache Tika Server published as [apache/tika](https://hub.docker.com/r/apache/tika) on DockerHub by the [Apache Tika](http://tika.apache.org) Dev team
4 |
5 | The images create a functional Apache Tika Server instance that contains the latest Ubuntu running the appropriate version's server on Port 9998 using Java 8 (until version 1.20), Java 11 (1.21 and 1.24.1), Java 14 (until 1.27/2.0.0), Java 16 (for 2.1.0), and Java 17 LTS for newer versions.
6 |
7 | There is a minimal version, which contains only Apache Tika and it's core dependencies, and a full version, which also includes dependencies for the GDAL and Tesseract OCR parsers. To balance showing functionality versus the size of the full image, this file currently installs the language packs for the following languages:
8 | * English
9 | * French
10 | * German
11 | * Italian
12 | * Spanish
13 | * Japanese
14 |
15 | To install more languages simply update the apt-get command to include the package containing the language you required, or include your own custom packs using an ADD command.
16 |
17 | ## Available Tags
18 |
19 | Below are the most recent 3.x series tags:
20 | - `latest`, `3.2.3.0`: Apache Tika Server 3.2.3.0 (Minimal)
21 | - `latest-full`, `3.2.3.0-full`: Apache Tika Server 3.2.3.0 (Full)
22 | - `3.2.3.0`, `3.2.3.0`: Apache Tika Server 3.2.3.0 (Minimal)
23 | - `3.2.3.0`, `3.2.3.0-full`: Apache Tika Server 3.2.3.0 (Full)
24 | - `3.2.2.0`, `3.2.2.0`: Apache Tika Server 3.2.2.0 (Minimal)
25 | - `3.2.2.0`, `3.2.2.0-full`: Apache Tika Server 3.2.2.0 (Full)
26 | - `3.2.1.0`, `3.2.1.0`: Apache Tika Server 3.2.1.0 (Minimal)
27 | - `3.2.1.0`, `3.2.1.0-full`: Apache Tika Server 3.2.1.0 (Full)
28 | - `3.2.0.0`, `3.2.0.0`: Apache Tika Server 3.2.0.0 (Minimal)
29 | - `3.2.0.0`, `3.2.0.0-full`: Apache Tika Server 3.2.0.0 (Full)
30 | - `3.1.0.0`, `3.1.0.0`: Apache Tika Server 3.1.0.0 (Minimal)
31 | - `3.1.0.0`, `3.1.0.0-full`: Apache Tika Server 3.1.0.0 (Full)
32 | - `3.0.0.0`, `3.0.0.0`: Apache Tika Server 3.0.0.0 (Minimal)
33 | - `3.0.0.0`, `3.0.0.0-full`: Apache Tika Server 3.0.0.0 (Full)
34 | - `3.0.0.0-BETA2`, `3.0.0.0-BETA2`: Apache Tika Server 3.0.0.0-BETA2 (Minimal)
35 | - `3.0.0.0-BETA2`, `3.0.0.0-BETA2-full`: Apache Tika Server 3.0.0.0-BETA2 (Full)
36 | - `2.9.2.1`, `2.9.2.1`: Apache Tika Server 2.9.2.1 (Minimal)
37 | - `2.9.2.1`, `2.9.2.1-full`: Apache Tika Server 2.9.2.1 (Full)
38 | - `2.9.2.0`, `2.9.2.0`: Apache Tika Server 2.9.2.0 (Minimal)
39 | - `2.9.2.0`, `2.9.2.0-full`: Apache Tika Server 2.9.2.0 (Full)
40 | - `2.9.1.0`, `2.9.1.0`: Apache Tika Server 2.9.1.0 (Minimal)
41 | - `2.9.1.0`, `2.9.1.0-full`: Apache Tika Server 2.9.1.0 (Full)
42 | - `2.9.0.0`, `2.9.0.0`: Apache Tika Server 2.9.0.0 (Minimal)
43 | - `2.9.0.0`, `2.9.0.0-full`: Apache Tika Server 2.9.0.0 (Full)
44 | - `2.8.0.0`, `2.8.0.0`: Apache Tika Server 2.8.0.0 (Minimal)
45 | - `2.8.0.0`, `2.8.0.0-full`: Apache Tika Server 2.8.0.0 (Full)
46 | - `2.7.0.1`, `2.7.0.1`: Apache Tika Server 2.7.0.1 (Minimal)
47 | - `2.7.0.1`, `2.7.0.1-full`: Apache Tika Server 2.7.0.1 (Full)
48 | - `2.7.0.0`, `2.7.0.0`: Apache Tika Server 2.7.0.0 (Minimal)
49 | - `2.7.0.0`, `2.7.0.0-full`: Apache Tika Server 2.7.0.0 (Full)
50 | - `2.6.0.1`: Apache Tika Server 2.6.0.1 (Minimal)
51 | - `2.6.0.1-full`: Apache Tika Server 2.6.0.1 (Full)
52 | - `2.6.0.0`: Apache Tika Server 2.6.0.0 (Minimal)
53 | - `2.6.0.0-full`: Apache Tika Server 2.6.0.0 (Full)
54 | - `2.5.0.2`: Apache Tika Server 2.5.0.2 (Minimal)
55 | - `2.5.0.2-full`: Apache Tika Server 2.5.0.2 (Full)
56 | - `2.5.0.1`: Apache Tika Server 2.5.0.1 (Minimal)
57 | - `2.5.0.1-full`: Apache Tika Server 2.5.0.1 (Full)
58 | - `2.5.0`: Apache Tika Server 2.5.0 (Minimal)
59 | - `2.5.0-full`: Apache Tika Server 2.5.0 (Full)
60 | - `2.4.1`: Apache Tika Server 2.4.1 (Minimal)
61 | - `2.4.1-full`: Apache Tika Server 2.4.1 (Full)
62 | - `2.4.0`: Apache Tika Server 2.4.0 (Minimal)
63 | - `2.4.0-full`: Apache Tika Server 2.4.0 (Full)
64 | - `2.3.0`: Apache Tika Server 2.3.0 (Minimal)
65 | - `2.3.0-full`: Apache Tika Server 2.3.0 (Full)
66 | - `2.2.1`: Apache Tika Server 2.2.1 (Minimal)
67 | - `2.2.1-full`: Apache Tika Server 2.2.1 (Full)
68 |
69 | Below are the most recent 1.x series tags. **Note** that as of 30 September 2022, the 1.x branch is no longer supported.
70 |
71 | - `1.28.5`: Apache Tika Server 1.28.5 (Minimal)
72 | - `1.28.5-full`: Apache Tika Server 1.28.5 (Full)
73 | - `1.28.4`: Apache Tika Server 1.28.4 (Minimal)
74 | - `1.28.4-full`: Apache Tika Server 1.28.4 (Full)
75 | - `1.28.3`: Apache Tika Server 1.28.3 (Minimal)
76 | - `1.28.3-full`: Apache Tika Server 1.28.3 (Full)
77 | - `1.28.2`: Apache Tika Server 1.28.2 (Minimal)
78 | - `1.28.2-full`: Apache Tika Server 1.28.2 (Full)
79 | - `1.28.1`: Apache Tika Server 1.28.1 (Minimal)
80 | - `1.28.1-full`: Apache Tika Server 1.28.1 (Full)
81 |
82 | You can see a full set of tags for historical versions [here](https://hub.docker.com/r/apache/tika/tags?page=1&ordering=last_updated).
83 |
84 | ## Usage
85 |
86 | ### Default
87 |
88 | You can pull down the version you would like using:
89 |
90 | docker pull apache/tika:
91 |
92 | Then to run the container, execute the following command:
93 |
94 | docker run -d -p 127.0.0.1:9998:9998 apache/tika:
95 |
96 | Where is the DockerHub tag corresponding to the Apache Tika Server version - e.g. 1.23, 1.22, 1.23-full, 1.22-full.
97 |
98 | NOTE: The latest and latest-full tags are explicitly set to the latest released version when they are published.
99 |
100 | NOTE: In the example above, we recommend binding the server to localhost because Docker alters iptables and may expose
101 | your tika-server to the internet. If you are confident that your tika-server is on an isolated network
102 | you can simply run:
103 |
104 | docker run -d -p 9998:9998 apache/tika:
105 |
106 | ### Custom Config
107 |
108 | From version 1.25 and 1.25-full of the image it is now easier to override the defaults and pass parameters to the running instance.
109 |
110 | So for example if you wish to disable the OCR parser in the full image you could write a custom configuration:
111 |
112 | ```
113 | cat <> tika-config.xml
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | EOT
123 | ```
124 | Then by mounting this custom configuration as a volume, you could pass the command line parameter to load it
125 |
126 | docker run -d -p 127.0.0.1:9998:9998 -v `pwd`/tika-config.xml:/tika-config.xml apache/tika:2.5.0-full --config /tika-config.xml
127 |
128 | You can see more configuration examples [here](https://tika.apache.org/2.5.0/configuring.html).
129 |
130 | As of 2.5.0.2, if you'd like to add extra jars from your local `my-jars` directory to Tika's classpath, mount to `/tika-extras` like so:
131 |
132 | docker run -d -p 127.0.0.1:9998:9998 -v `pwd`/my-jars:/tika-extras apache/tika:2.5.0.2-full
133 |
134 | You may want to do this to add optional components, such as the tika-eval metadata filter, or optional
135 | dependencies such as jai-imageio-jpeg2000 (check license compatibility first!).
136 |
137 | ### Docker Compose Examples
138 |
139 | There are a number of sample Docker Compose files included in the repos to allow you to test some different scenarios.
140 |
141 | These files use docker-compose 3.x series and include:
142 |
143 | * docker-compose-tika-vision.yml - TensorFlow Inception REST API Vision examples
144 | * docker-compose-tika-grobid.yml - Grobid REST parsing example
145 | * docker-compose-tika-customocr.yml - Tesseract OCR example with custom configuration
146 | * docker-compose-tika-ner.yml - Named Entity Recognition example
147 |
148 | The Docker Compose files and configurations (sourced from _sample-configs_ directory) all have comments in them so you can try different options, or use them as a base to create your own custom configuration.
149 |
150 | **N.B.** You will want to create a environment variable (used in some bash scripts) matching the version of tika-docker you want to work with in the docker compositions e.g. `export TAG=1.26`. Similarly you should also consult `.env` which is used in the docker-compose `.yml` files.
151 |
152 | You can install docker-compose from [here](https://docs.docker.com/compose/install/).
153 |
154 | ## Building
155 |
156 | To build the image from scratch, simply invoke:
157 |
158 | docker build -t 'apache/tika' github.com/apache/tika-docker
159 |
160 | You can then use the following command (using the name you allocated in the build command as part of -t option):
161 |
162 | docker run -d -p 127.0.0.1:9998:9998 apache/tika
163 |
164 | ## More Information
165 |
166 | For more infomation on Apache Tika Server, go to the [Apache Tika Server documentation](https://cwiki.apache.org/confluence/display/TIKA/TikaServer).
167 |
168 | For more information on Apache Tika, go to the official [Apache Tika](http://tika.apache.org) project website.
169 |
170 | To meet up with others using Apache Tika, consider coming to one of the [Apache Tika Virtual Meetups](https://www.meetup.com/apache-tika-community/).
171 |
172 | For more information on the Apache Software Foundation, go to the [Apache Software Foundation](http://apache.org) website.
173 |
174 | For a full list of changes as of 2.5.0.1, visit [CHANGES.md](CHANGES.md).
175 |
176 | For our current release process, visit [tika-docker Release Process](https://cwiki.apache.org/confluence/display/TIKA/Release+Process+for+tika-docker)
177 |
178 | ## Authors
179 |
180 | Apache Tika Dev Team (dev@tika.apache.org)
181 |
182 | ## Contributors
183 |
184 | There have been a range of [contributors](https://github.com/apache/tika-docker/graphs/contributors) on GitHub and via suggestions, including:
185 |
186 | - [@grossws](https://github.com/grossws)
187 | - [@arjunyel](https://github.com/arjunyel)
188 | - [@mpdude](https://github.com/mpdude)
189 | - [@laszlocsontosuw](https://github.com/laszlocsontosuw)
190 | - [@tallisonapache](https://github.com/tballison)
191 |
192 | ## License
193 |
194 | Licensed under the Apache License, Version 2.0 (the "License");
195 | you may not use this file except in compliance with the License.
196 | You may obtain a copy of the License at
197 |
198 | http://www.apache.org/licenses/LICENSE-2.0
199 |
200 | Unless required by applicable law or agreed to in writing, software
201 | distributed under the License is distributed on an "AS IS" BASIS,
202 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203 | See the License for the specific language governing permissions and
204 | limitations under the License.
205 |
206 | ## Disclaimer
207 |
208 | It is worth noting that whilst these Docker images download the binary JARs published by the Apache Tika Team on the Apache Software Foundation distribution sites, only the source release of an Apache Software Foundation project is an official release artefact. See [Release Distribution Policy](https://www.apache.org/dev/release-distribution.html) for more details.
209 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------