Skip to content

Commit df1fd2a

Browse files
dsmileyRoSk0HoustonPutman
authored
Ref Guide: Docker, add headings (#263)
* Add sub-headers to "Creating cores" section * Add custom configset example to solr-precreate section docker-solr/docker-solr#383 Co-authored-by: Kirill Roskolii <[email protected]> Co-authored-by: Houston Putman <[email protected]>
1 parent 919ad85 commit df1fd2a

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

solr/solr-ref-guide/src/solr-in-docker.adoc

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ When Solr runs in standalone mode, you create "cores" to store data.
107107
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.
108108
With Solr docker you have various options.
109109

110+
==== Manually
111+
110112
The first is exactly the same: start Solr running in a container, then execute the control script manually in the same container:
111113

112114
[source,bash]
@@ -116,16 +118,27 @@ docker exec -it my_solr solr create_core -c gettingstarted
116118
----
117119

118120
This is not very convenient for users, and makes it harder to turn it into configuration for Docker Compose and orchestration tools like Kubernetes.
121+
122+
==== Using solr-precreate Command
123+
119124
So, typically you will use the `solr-precreate` command which prepares the specified core and then runs Solr:
120125

121126
[source,bash]
122127
----
123128
docker run -d -p 8983:8983 --name my_solr solr solr-precreate gettingstarted
124129
----
125130

126-
The `solr-precreate` command takes an optional extra argument to specify a configset directory below `/opt/solr/server/solr/configsets/`.
127-
This allows you to specify your own config.
128-
See https://github.com/docker-solr/docker-solr-examples/tree/master/custom-configset[this example].
131+
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:
132+
133+
[source,bash]
134+
----
135+
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
136+
----
137+
138+
N.B. When specifying the full path to the configset, the actual core configuration should be located inside that directory in the `conf` directory.
139+
See <<config-sets.adoc#,Configsets>> for details.
140+
141+
==== Using solr-create Command
129142

130143
The third option is to use the `solr-create` command.
131144
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.
136149
docker run -d -p 8983:8983 --name my_solr solr solr-create -c gettingstarted
137150
----
138151

152+
==== Custom Set-Up Scripts
153+
139154
Finally, you can run your own command-line and specify what to do, and even invoke mounted scripts.
140155
For example:
141156

0 commit comments

Comments
 (0)