Skip to content

Commit 0a938e4

Browse files
Run update.sh
1 parent 40a3acf commit 0a938e4

File tree

2 files changed

+132
-29
lines changed

2 files changed

+132
-29
lines changed

debian/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Supported tags and respective `Dockerfile` links
22

3-
- [`8.5`, `8`, `jessie`, `latest` (*jessie/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/jessie/Dockerfile)
4-
- [`jessie-backports` (*jessie/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/jessie/backports/Dockerfile)
5-
- [`oldstable` (*oldstable/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/oldstable/Dockerfile)
6-
- [`oldstable-backports` (*oldstable/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/oldstable/backports/Dockerfile)
7-
- [`sid` (*sid/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/0262f960f1f11cea2b3b73c4e04f52cb4219f8ea/sid/Dockerfile)
8-
- [`stable` (*stable/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/stable/Dockerfile)
9-
- [`stable-backports` (*stable/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/stable/backports/Dockerfile)
10-
- [`stretch` (*stretch/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/0262f960f1f11cea2b3b73c4e04f52cb4219f8ea/stretch/Dockerfile)
11-
- [`testing` (*testing/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/0262f960f1f11cea2b3b73c4e04f52cb4219f8ea/testing/Dockerfile)
12-
- [`unstable` (*unstable/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/0262f960f1f11cea2b3b73c4e04f52cb4219f8ea/unstable/Dockerfile)
13-
- [`7.11`, `7`, `wheezy` (*wheezy/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/wheezy/Dockerfile)
14-
- [`wheezy-backports` (*wheezy/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/589b967ff4364528ebd686b002a6ee00f00f4657/wheezy/backports/Dockerfile)
3+
- [`8.6`, `8`, `jessie`, `latest` (*jessie/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/jessie/Dockerfile)
4+
- [`jessie-backports` (*jessie/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/jessie/backports/Dockerfile)
5+
- [`oldstable` (*oldstable/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/oldstable/Dockerfile)
6+
- [`oldstable-backports` (*oldstable/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/oldstable/backports/Dockerfile)
7+
- [`sid` (*sid/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/5262a068af848af6e4084a1853999f4df1d68a2a/sid/Dockerfile)
8+
- [`stable` (*stable/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/stable/Dockerfile)
9+
- [`stable-backports` (*stable/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/stable/backports/Dockerfile)
10+
- [`stretch` (*stretch/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/5262a068af848af6e4084a1853999f4df1d68a2a/stretch/Dockerfile)
11+
- [`testing` (*testing/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/5262a068af848af6e4084a1853999f4df1d68a2a/testing/Dockerfile)
12+
- [`unstable` (*unstable/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/5262a068af848af6e4084a1853999f4df1d68a2a/unstable/Dockerfile)
13+
- [`7.11`, `7`, `wheezy` (*wheezy/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/wheezy/Dockerfile)
14+
- [`wheezy-backports` (*wheezy/backports/Dockerfile*)](https://github.com/tianon/docker-brew-debian/blob/261f8d1fd3b61f1f790c1f47b006ca150064189b/wheezy/backports/Dockerfile)
1515
- [`rc-buggy` (*debian/rc-buggy/Dockerfile*)](https://github.com/tianon/dockerfiles/blob/22a998f815d55217afa0075411b810b8889ceac1/debian/rc-buggy/Dockerfile)
1616
- [`experimental` (*debian/experimental/Dockerfile*)](https://github.com/tianon/dockerfiles/blob/22a998f815d55217afa0075411b810b8889ceac1/debian/experimental/Dockerfile)
1717

solr/README.md

Lines changed: 120 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Learn more on [Apache Solr homepage](http://lucene.apache.org/solr/) and in the
2929

3030
# How to use this Docker image
3131

32+
## Run Solr and index example data
33+
3234
To run a single Solr server:
3335

3436
```console
@@ -45,46 +47,147 @@ $ docker exec -it --user=solr my_solr bin/solr create_core -c gettingstarted
4547

4648
In the web UI if you click on "Core Admin" you should now see the "gettingstarted" core.
4749

48-
If you want to load some example data:
50+
If you want to load some of the example data that is included in the container:
4951

5052
```console
5153
$ docker exec -it --user=solr my_solr bin/post -c gettingstarted example/exampledocs/manufacturers.xml
5254
```
5355

54-
In the UI, find the "Core selector" popup menu and select the "gettingstarted" core, then select the "Query" menu item. This gives you a default search for "*:*" which returns all docs. Hit the "Execute Query" button, and you should see a few docs with data. Congratulations!
56+
In the UI, find the "Core selector" popup menu and select the "gettingstarted" core, then select the "Query" menu item. This gives you a default search for `*:*` which returns all docs. Hit the "Execute Query" button, and you should see a few docs with data. Congratulations!
57+
58+
## Single-command demo
59+
60+
For convenience, there is a single command that starts Solr, creates a collection called "demo", and loads sample data into it:
61+
62+
```console
63+
$ docker run --name solr_demo -d -P solr solr-demo
64+
```
65+
66+
## Loading your own data
67+
68+
If you want load your own data, you'll have to make it available to the container, for example by copying it into the container:
69+
70+
```console
71+
$ docker cp $HOME/mydata/mydata.xml my_solr:/opt/solr/mydata.xml
72+
$ docker exec -it --user=solr my_solr bin/post -c gettingstarted mydata.xml
73+
```
74+
75+
or by using Docker host volumes:
76+
77+
```console
78+
$ docker run --name my_solr -d -p 8983:8983 -t -v $HOME/mydata:/opt/solr/mydata solr
79+
$ docker exec -it --user=solr my_solr bin/solr create_core -c gettingstarted
80+
$ docker exec -it --user=solr my_solr bin/post -c gettingstarted mydata/mydata.xml
81+
```
5582

5683
To learn more about Solr, see the [Apache Solr Reference Guide](https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide).
5784

58-
## Distributed Solr
85+
## Creating Cores
86+
87+
In addition to the `docker exec` method explained above, you can create a core automatically at start time, in several ways.
88+
89+
If you run:
90+
91+
```console
92+
$ docker run -d -P solr solr-create -c mycore
93+
```
5994

60-
You can also run a distributed Solr configuration, with Solr nodes in separate containers, sharing a single ZooKeeper server:
95+
the container will:
6196

62-
Run ZooKeeper, and define a name so we can link to it:
97+
- run Solr in the background, on the loopback interface
98+
- wait for it to start
99+
- run the "solr create" command with the arguments you passed
100+
- stop the background Solr
101+
- start Solr in the foreground
102+
103+
You can combine this with mounted volumes to pass in core configuration from your host:
63104

64105
```console
65-
$ docker run --name zookeeper -d -p 2181:2181 -p 2888:2888 -p 3888:3888 jplock/zookeeper
106+
$ docker run -d -P -v $PWD/myconfig:/myconfig solr solr-create -c mycore -d /myconfig
66107
```
67108

68-
Run two Solr nodes, linked to the zookeeper container:
109+
When using the `solr-create` command, Solr will log to the standard docker log (inspect with `docker logs`), and the collection creation will happen in the background and log to `/opt/docker-solr/init.log`.
110+
111+
This first way closely mirrors the manual core creation steps and uses Solr's own tools to create the core, so should be reliable.
112+
113+
The second way of creating a core at start time is using the `solr-precreate` command. This will create the core in the filesystem before running Solr. You should pass it the core name, and optionally the directory to copy the config from (this defaults to Solr's built-in "basic_configs"). For example:
69114

70115
```console
71-
$ docker run --name solr1 --link zookeeper:ZK -d -p 8983:8983 \
72-
solr \
73-
bash -c '/opt/solr/bin/solr start -f -z $ZK_PORT_2181_TCP_ADDR:$ZK_PORT_2181_TCP_PORT'
116+
$ docker run -d -P solr solr-precreate mycore
117+
$ docker run -d -P -v $PWD/myconfig:/myconfig solr solr-precreate mycore /myconfig
118+
```
119+
120+
This method stores the core in an intermediate subdirectory called "mycores". This allows you to use mounted volumes:
121+
122+
```console
123+
$ mkdir mycores
124+
$ sudo chown 8983:8983 mycores
125+
$ docker run -d -P -v $PWD/mycores:/opt/solr/server/solr/mycores solr solr-precreate mycore
126+
```
127+
128+
This second way is quicker, easier to monitor because it logs to the docker log, and can fail immediately if something is wrong. But, because it makes assumptions about Solr's "basic_configs", future upstream changes could break that.
129+
130+
The third way of creating a core at startup is to use the image extension mechanism explained in the next section.
131+
132+
## Using Docker Compose
133+
134+
With Docker Compose you can create a Solr container with the index stored in a named data volume. Create a `docker-compose.yml` like:
135+
136+
```yml
137+
version: '2'
138+
services:
139+
solr:
140+
image: solr
141+
ports:
142+
- "8983:8983"
143+
volumes:
144+
- data:/opt/solr/server/solr/mycores
145+
entrypoint:
146+
- docker-entrypoint.sh
147+
- solr-precreate
148+
- mycore
149+
volumes:
150+
data:
151+
```
152+
153+
and just run `docker-compose up`.
74154

75-
$ docker run --name solr2 --link zookeeper:ZK -d -p 8984:8983 \
76-
solr \
77-
bash -c '/opt/solr/bin/solr start -f -z $ZK_PORT_2181_TCP_ADDR:$ZK_PORT_2181_TCP_PORT'
155+
## Extending the image
156+
157+
The docker-solr image has an extension mechanism. At run time, before starting Solr, the container will execute scripts in the `/docker-entrypoint-initdb.d/` directory. You can add your own scripts there either by using mounted volumes or by using a custom Dockerfile. These scripts can for example copy a core directory with pre-loaded data for continuous integration testing, or modify the Solr configuration.
158+
159+
Here is a simple example. With a `set-heap.sh` script like:
160+
161+
```console
162+
#!/bin/bash
163+
set -e
164+
cp /opt/solr/bin/solr.in.sh /opt/solr/bin/solr.in.sh.orig
165+
sed -e 's/SOLR_HEAP=".*"/SOLR_HEAP="1024m"/' </opt/solr/bin/solr.in.sh.orig >/opt/solr/bin/solr.in.sh
166+
grep '^SOLR_HEAP=' /opt/solr/bin/solr.in.sh
78167
```
79168

80-
Create a collection:
169+
you can run:
81170

82171
```console
83-
$ docker exec -i -t solr1 /opt/solr/bin/solr create_collection \
84-
-c collection1 -shards 2 -p 8983
172+
$ docker run --name solr_heap1 -d -P -v $PWD/docs/set-heap.sh:/docker-entrypoint-initdb.d/set-heap.sh solr
173+
$ sleep 5
174+
$ docker logs solr_heap1 | head
175+
/opt/docker-solr/scripts/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/set-heap.sh
176+
SOLR_HEAP="1024m"
177+
178+
179+
Starting Solr on port 8983 from /opt/solr/server
85180
```
86181

87-
Then go to `http://localhost:8983/solr/#/~cloud` (adjust the hostname for your docker host) to see the two shards and Solr nodes.
182+
With this extension mechanism it can be useful to see the shell commands that are being executed by the `docker-entrypoint.sh` script in the docker log. To do that, set an environment variable using Docker's `-e VERBOSE=yes`.
183+
184+
## Distributed Solr
185+
186+
You can also run a distributed Solr configuration.
187+
188+
The recommended and most flexible way to do that is to use Docker networking. See the [Can I run ZooKeeper and Solr clusters under Docker](https://github.com/docker-solr/docker-solr/blob/master/Docker-FAQ.md#can-i-run-zookeeper-and-solr-clusters-under-docker) FAQ, and [this example](docs/docker-networking.md).
189+
190+
You can also use legacy links, see the [Can I run ZooKeeper and Solr with Docker Links](Docker-FAQ.md#can-i-run-zookeeper-and-solr-clusters-under-docker) FAQ.
88191

89192
# About this repository
90193

0 commit comments

Comments
 (0)