š Apache Tika server with OCR on and extra Tesseract languages.
š¹ f3l1x.ioā | š» f3l1xā | š¦ @xf3l1xā
Apache Tikaā server that extracts text and metadata from PDF, Office, images and 1000+ other
formats. The upstream apache/tika:<version>-full image has only 7 OCR languages and does not OCR scanned PDFs. This
image adds 20 languages and turns OCR on.
3.3.1.0 on the upstream -full image (Tesseract 5, GDAL, ImageMagick)osd, see the table below:9464/metrics (jmx_exporterā 1.7.0)/version35002:35002 and port 9998 are the same as upstream| Code | Language | Code | Language |
|---|---|---|---|
ara | Arabic | jpn | Japanese |
ces | Czech | kor | Korean |
chi_sim | Chinese simplified | nld | Dutch |
chi_tra | Chinese traditional | pol | Polish |
deu | German | por | Portuguese |
eng | English | rus | Russian |
fra | French | slk | Slovak |
hin | Hindi | spa | Spanish |
hun | Hungarian | tur | Turkish |
ita | Italian | ukr | Ukrainian |
docker run --rm -it -p 9998:9998 -p 9464:9464 dockette/tika:latest
# Text
curl -T document.pdf -H 'Accept: text/plain' http://localhost:9998/tika
# OCR in another language (default is eng), or in more languages
curl -T scan.pdf -H 'Accept: text/plain' -H 'X-Tika-OCRLanguage: slk' http://localhost:9998/tika
curl -T scan.pdf -H 'Accept: text/plain' -H 'X-Tika-OCRLanguage: eng+ces' http://localhost:9998/tika
# OCR every page, also when the PDF has a text layer
curl -T doc.pdf -H 'Accept: text/plain' -H 'X-Tika-PDFocrStrategy: ocr_and_text_extraction' http://localhost:9998/tika
# Text and metadata of every embedded document, as JSON
curl -T archive.zip http://localhost:9998/rmeta/text
The image runs with tika-config.xmlā :
ocrStrategy=auto: read the text layer, OCR only pages without textocrDPI=250: measured on scanned invoices; the Tika default 300 gave worse resultsextractInlineImages=false: true OCRs each page twice and duplicates the textlanguage=eng, pageSegMode=1, timeoutSeconds=300To use your own file, mount it. Copy the <server> block from ours to keep the metrics.
docker run --rm -it -p 9998:9998 -v $(pwd)/tika-config.xml:/tika-config.xml:ro dockette/tika:latest
Arguments after the image name replace the default --config /tika-config.xml and go to TikaServerCli -h 0.0.0.0.
Set the heap in forkedJvmArgs, for example <arg>-Xmx4g</arg>. Without it, the JVM sizes the heap from host RAM. Do
not use JAVA_TOOL_OPTIONS: it applies to both JVMs.
Tika parses in a child JVM (TikaServerProcess). The child loads the jmx_exporter agent and serves jvm_* and
process_* metrics on port 9464. Tika has no metrics of its own, so there are no per-request metrics. When the child
restarts (OOM or timeout), process_start_time_seconds changes.
| Version | Release |
|---|---|
dockette/tika:3.3.1.0-YYYY.MM.DD | release YYYY.MM.DD |
dockette/tika:3.3.1.0 | latest release |
dockette/tika:YYYY.MM.DD | release YYYY.MM.DD |
dockette/tika:latest | latest build of master |
All versions build on apache/tika:3.3.1.0-full. Releases are listed on GitHubā .
make build # build the image
make test # check languages and config
make test-docker # start the server and OCR a scanned PDF
make run # run the server on port 19998
make shell # open a shell in the image
make push # build and push linux/amd64 and linux/arm64
make version # print VERSION
make release # set today's date in VERSION
See how to contributeā to this package. Consider to supportā f3l1x. Thank you for using this package.
Content type
Image
Digest
sha256:08ec97c0fā¦
Size
390.6 MB
Last updated
about 5 hours ago
docker pull dockette/tikaPulls:
18
Oct 12 to Oct 18