I appreciate your help, it works now.
What does the `--config /tika-config.xml` do and how can I, if possible add
this flag to my Dockerfile?


On Thu, Apr 27, 2023 at 9:11 PM Konstantin Gribov <[email protected]> wrote:

> Hello.
>
> Most likely that docker couldn't find the tika-config.xml file at the
> directory where you tried to start docker, created tika-config.xml/
> directory and mounted it inside of the container.
>
> If you're using Docker on Windows or MacOS there should be additional
> actions to pass a file into the container.
>
> As a workaround you could create a docker image with your config, just
> create a Dockerfile
>
> ```
> FROM apache/tika:2.7.0.1-full
> ADD tika-config.xml /tika-config.xml
> ```
>
> Then run docker `build -t tika-custom:latest .`, wait for it to finish and
> try that image instead of the apache/tika: `docker run -d -p 
> 127.0.0.1:9998:9998
> tika-custom:latest --config /tika-config.xml`.
>
> --
> Best regards,
> Konstantin Gribov.
>
>
> ‪On Thu, Apr 27, 2023 at 8:54 PM ‫שי ברק‬‎ <[email protected]> wrote:‬
>
>> Hey,
>> I have my custom tika-config.xml on my Desktop.
>> when I run the following command from my Desktop:
>>
>> docker run -d -p 127.0.0.1:9998:9998 -v
>> ./tika-config.xml:/tika-config.xml apache/tika:2.5.0-full --config
>> /tika-config.xml
>>
>> I get the following error message:
>>
>> ERROR [main] 17:53:29,564 org.apache.tika.server.core.TikaServerCli Can't
>> start:
>> java.io.IOException: Is a directory
>>         at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
>>         at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:48)
>> ~[?:?]
>>         at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:330) ~[?:?]
>>         at sun.nio.ch.IOUtil.read(IOUtil.java:296) ~[?:?]
>>         at sun.nio.ch.IOUtil.read(IOUtil.java:273) ~[?:?]
>>         at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:232)
>> ~[?:?]
>>         at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
>> ~[?:?]
>>         at
>> sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:107) ~[?:?]
>>         at
>> sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:101) ~[?:?]
>>         at java.io.InputStream.read(InputStream.java:218) ~[?:?]
>>         at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:81)
>> ~[?:?]
>>         at
>> org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.readAndBuffer(Unknown
>> Source) ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
>> Source) ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
>> Source) ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
>> Source) ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
>> Source) ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122) ~[?:?]
>>         at
>> org.apache.tika.utils.XMLReaderUtils.buildDOM(XMLReaderUtils.java:483)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.tika.config.ConfigBase.configure(ConfigBase.java:506)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.tika.server.core.TikaServerConfig.load(TikaServerConfig.java:211)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.tika.server.core.TikaServerConfig.load(TikaServerConfig.java:198)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.tika.server.core.TikaServerConfig.load(TikaServerConfig.java:155)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>         at
>> org.apache.tika.server.core.TikaServerCli.main(TikaServerCli.java:77)
>> ~[tika-server-standard-2.6.0.jar:2.6.0]
>>
>>
>> Does anyone know why?
>> thanks.
>>
>

Reply via email to