DEPRECATION NOTICE: Please use my Solr Container project and Docker Hub images instead!
The official Solr repository for Docker is well-maintained and helpful in many use cases, but I need a slightly more customized build for my projects. Therefore, this is a Docker container to build different versions of Solr that I need in production.
This image is built on Docker Hub automatically any time the upstream Docker image is rebuilt, and any time a commit is made or merged to the master
branch. But if you need to build the image on your own locally, do the following:
- Install Docker.
cd
into this directory.- Run
docker build -t docker-image-solr .
- Install Docker.
cd
into thetests
directory.- Run
docker-compose up -d
- Visit http://localhost:8983/ in a browser, and you should see the Apache Solr admin interface.
- Click on 'Core Admin'.
- You should see the
new_core
that you configured in the listing. - Solr is ready to work with your application, using the
new_core
!
When you're finished testing, run docker-compose stop
to stop Solr, and docker-compose rm
to delete the Solr container (the local core data—config and index data—on your host will be preserved).
Seeing a running Solr instance looks pretty... but means nothing in the real world. This container was created to solve the real-world problem of running multiple independent Solr cores, isolated one per Solr instance, on one or multiple Docker hosts.
And on top of that, the creation and maintenance of all the Solr containers should be fully automated. You should be able to build or rebuild all your Solr containers at the drop of a hat, while all the contents of each Solr index are preserved. That's why we're using Docker!
The fastest way to grab and use this container for 'quick and dirty' testing (e.g. to inspect the container or play around with it) is to use the following docker run
command:
docker run --detach --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro -p 8983:8983 geerlingguy/docker-image-solr:latest /sbin/init
This is basically the same thing as what's defined in the docker-compose.yml
file in the tests directory, but allows you to manage one container by hand.
TODO.
You can override default geerlingguy.java
and geerlingguy.solr
Ansible role configuration variables by adding a config.yml
fil inside the provisioning
folder alongside the default.config.yml
file.
MIT / BSD
This image was created in 2017 by Jeff Geerling, author of Ansible for DevOps.