Docker Solr: Cannot index local data folder
$ docker exec -it --user=solr my_solr bin/solr create_core -c gettingstarted
Afterwards I wanted to index a folder containing pdf files like so:
$ docker exec -it --user=solr my_solr bin/post -c gettingstarted ./some_pdfs/
I get an error saying:
Unrecognized argument: ./some_pdfs/ If this was intended to be a data file, it does not exist relative to /opt/solr
I know that if I ssh into my docker container, there is an /opt/solr folder. But my intention is to index files on my local hard disk. How can I do this?
It turns out that I cannot index local files from my laptop using this docker container like above.
I followed instructions in the excellent book “Pro Docker” from Deepak Vohra and copied a test PDF file to the docker container like so:
sudo docker cp mydocument.pdf 8065379d1f16:/opt/solr/mydocument.pdf
then logged into that docker container like so:
docker exec -it –user=solr my_solr bash
and started the bin/post command from docker container. That worked.