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 data-only container and dealing with new releases
  • Cassandra connection idling and timing out
  • Enable Remote API on Docker hosts in Ubuntu 14
  • Development env NodeJS and Docker
  • How to run NodeJS command-line tools inside Docker?
  • Kubernetes and network control
  • $ 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?

    [1] https://hub.docker.com/r/library/solr/


    UPDATE

    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.

  • How to increase ulimit in Docker in Elastic Beanstalk?
  • docker's VOLUME isn't mounting host files
  • How to remove a pushed image in Google Container Registry
  • Dockerfile : not able to use add to map local file to container
  • Connecting Sails Socket IO to Sails server running in consul
  • Setting Team City Build Agent Port Number in Marathon
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.