Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Ref Guide: Docker, add headings (#263)

David Smileydf1fd2a6ae41
diff --git a/solr/solr-ref-guide/src/solr-in-docker.adoc b/solr/solr-ref-guide/src/solr-in-docker.adoc
index d4f87a5561a..4953e4cdf10 100644
--- a/solr/solr-ref-guide/src/solr-in-docker.adoc
+++ b/solr/solr-ref-guide/src/solr-in-docker.adoc
@@ -107,6 +107,8 @@ When Solr runs in standalone mode, you create "cores" to store data.
On a non-Docker Solr, you would run the server in the background, then use the <<solr-control-script-reference.adoc#,Solr control script>> to create cores and load data.
With Solr docker you have various options.
+==== Manually
+
The first is exactly the same: start Solr running in a container, then execute the control script manually in the same container:
[source,bash]
@@ -116,6 +118,9 @@ docker exec -it my_solr solr create_core -c gettingstarted
----
This is not very convenient for users, and makes it harder to turn it into configuration for Docker Compose and orchestration tools like Kubernetes.
+
+==== Using solr-precreate Command
+
So, typically you will use the `solr-precreate` command which prepares the specified core and then runs Solr:
[source,bash]
@@ -123,9 +128,17 @@ So, typically you will use the `solr-precreate` command which prepares the speci
docker run -d -p 8983:8983 --name my_solr solr solr-precreate gettingstarted
----
-The `solr-precreate` command takes an optional extra argument to specify a configset directory below `/opt/solr/server/solr/configsets/`.
-This allows you to specify your own config.
-See https://github.com/docker-solr/docker-solr-examples/tree/master/custom-configset[this example].
+The `solr-precreate` command takes an optional extra argument to specify a configset directory below `/opt/solr/server/solr/configsets/` or you can specify a full path to a custom configset inside the container:
+
+[source,bash]
+----
+docker run -d -p 8983:8983 --name my_solr -v $PWD/config/solr:/my_core_config/conf solr:8 solr-precreate my_core /my_core_config
+----
+
+N.B. When specifying the full path to the configset, the actual core configuration should be located inside that directory in the `conf` directory.
+See <<config-sets.adoc#,Configsets>> for details.
+
+==== Using solr-create Command
The third option is to use the `solr-create` command.
This runs a Solr in the background in the container, then uses the Solr control script to create the core, then stops the Solr server and restarts it in the foreground.
@@ -136,6 +149,8 @@ This method is less popular because the double Solr run can be confusing.
docker run -d -p 8983:8983 --name my_solr solr solr-create -c gettingstarted
----
+==== Custom Set-Up Scripts
+
Finally, you can run your own command-line and specify what to do, and even invoke mounted scripts.
For example: