Docker Solr: Cannot index local data folder

I am using Docker in OS X. Just got the docker container “solr” from the official repo [1]. The container is up and running. Been following their instructions and created a “core” like so:

$ 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 - Install CI Server on a remote host
  • Updating kubectl with new configurations
  • How to import .bacpac into docker Sqlserver?
  • Cannot connect to WCF service hosted in Docker container
  • Unable to view rails app running in docker container from browser
  • Docker, communicating between hosts on different bridges
  • $ 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.

  • Visual Studio (2015) Debugging Integration Tests Runing in a DOCKER Container
  • Mac OS X sudo docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?
  • Pushing to docker registry fails: Error mounting /dev/mapper/…: device or resource busy
  • How to restrict access to path in Docker container?
  • Docker Google cloud
  • cURL from host-to-container works, but from container-to-container does not
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.