SOLR-15001 Docker: require init_var_solr.sh (#2083)

The Dockerfile should not initialize /var/solr's contents because this is confusing and redundant with init_var_solr.sh.
No need for init_var_solr.sh to echo what it does; VERBOSE can be used to accomplish that.

Separate CHANGES.md for Docker and contrib modules.
This commit is contained in:
David Smiley 2020-11-27 14:59:54 -05:00 committed by GitHub
parent 99c38eee49
commit 1e0ae2fb74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 27 deletions

View File

@ -192,6 +192,7 @@ def parse_properties_file(filename):
def get_solr_init_changes():
return dedent('''
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
Docker and contrib modules have separate CHANGES.md files.
''')

View File

@ -7,6 +7,7 @@ https://github.com/apache/lucene-solr/blob/master/solr/solr-ref-guide/src/solr-u
================== 9.0.0 ==================
Consult the lucene/CHANGES.txt file for additional, low level, changes in this release.
Docker and contrib modules have separate CHANGES.md files.
New Features
---------------------
@ -144,15 +145,11 @@ Other Changes
* SOLR-14944: Remove the "spins" metrics - support for detection of spinning disks has been
removed in LUCENE-9576. (ab)
* SOLR-14957: Add Prometheus Exporter to docker PATH. Fix classpath issues. (Houston Putman)
* SOLR-14912: Clean up solr-extraction contrib to produce solr-extraction-* jar
(instead of solr-cell-*). (Dawid Weiss)
* SOLR-14978: Enable OOM Killer Script in Solr Foreground. Simplify getting heap dumps on OOM. (Mike Drob, Houston Putman)
* SOLR-14949: Ability to customize docker image name/base image (Houston Putman)
* SOLR-14035: Remove deprecated preferLocalShards=true support in favour of the shards.preference=replica.location:local alternative.
(Alex Bulygin via Christine Poerschke)

28
solr/docker/CHANGES.md Normal file
View File

@ -0,0 +1,28 @@
This file lists release notes for this module.
Prior to version 9, the module existed in another repository and changes were not tracked in this manner.
You could browse the commit history here instead:
https://github.com/docker-solr/docker-solr
9.0.0
==================
Improvements
----------------------
* SOLR-14001: Removed /var/solr initialization from the Dockerfile; depend on init_var_solr.sh instead.
This leads to more consistent behavior no matter how /var/solr is mounted.
* init_var_solr.sh is now invoked by docker-entrypoint.sh; not in a bunch of other places.
* as before, you can set NO_INIT_VAR_SOLR=1 to short-circuit this.
* init_var_solr.sh no longer echo's anything. For verbosity, set VERBOSE=yes.
(David Smiley)
* SOLR-14957: Add Prometheus Exporter to docker PATH. Fix classpath issues.
(Houston Putman)
* SOLR-14949: Ability to customize the FROM image when building.
(Houston Putman)
Other Changes
------------------
* SOLR-14789: Migrate docker image creation from docker-solr repo to solr/docker.
(Houston Putman, Martijn Koster, Tim Potter, David Smiley, janhoy, Mike Drob)

View File

@ -59,11 +59,7 @@ RUN set -ex; \
mv /opt/solr/bin/solr.in.cmd /opt/solr/bin/solr.in.cmd.orig; \
chown root:0 /etc/default/solr.in.sh; \
chmod 0664 /etc/default/solr.in.sh; \
mkdir -p /var/solr/data /var/solr/logs; \
(cd /opt/solr/server/solr; cp solr.xml zoo.cfg /var/solr/data/); \
cp /opt/solr/server/resources/log4j2.xml /var/solr/log4j2.xml; \
find /var/solr -type d -print0 | xargs -0 chmod 0770; \
find /var/solr -type f -print0 | xargs -0 chmod 0660; \
mkdir -p -m0770 /var/solr; \
sed -i -e "s/\"\$(whoami)\" == \"root\"/\$(id -u) == 0/" /opt/solr/bin/solr; \
sed -i -e 's/lsof -PniTCP:/lsof -t -PniTCP:/' /opt/solr/bin/solr; \
chown -R "0:0" /opt/solr-$SOLR_VERSION /docker-entrypoint-initdb.d /opt/docker-solr; \

View File

@ -17,6 +17,9 @@ if ! [[ ${SOLR_PORT:-} =~ ^[0-9]+$ ]]; then
export SOLR_PORT
fi
# Essential for running Solr
/opt/docker-solr/scripts/init-var-solr
# when invoked with e.g.: docker run solr -help
if [ "${1:0:1}" == '-' ]; then
set -- solr-foreground "$@"

View File

@ -31,31 +31,29 @@ function check_dir_writability {
}
if [ ! -d "$DIR/data" ]; then
echo "Creating $DIR/data"
#echo "Creating $DIR/data"
check_dir_writability "$DIR"
mkdir "$DIR/data"
chmod 0770 "$DIR/data"
mkdir -m0770 "$DIR/data"
fi
if [ ! -d "$DIR/logs" ]; then
echo "Creating $DIR/logs"
#echo "Creating $DIR/logs"
check_dir_writability "$DIR"
mkdir "$DIR/logs"
chmod 0770 "$DIR/logs"
mkdir -m0770 "$DIR/logs"
fi
if [ ! -f "$DIR/data/solr.xml" ]; then
echo "Copying solr.xml"
#echo "Copying solr.xml"
cp -a /opt/solr/server/solr/solr.xml "$DIR/data/solr.xml"
fi
if [ ! -f "$DIR/data/zoo.cfg" ]; then
echo "Copying zoo.cfg"
#echo "Copying zoo.cfg"
cp -a /opt/solr/server/solr/zoo.cfg "$DIR/data/zoo.cfg"
fi
if [ ! -f "$DIR/log4j2.xml" ]; then
echo "Copying log4j2.xml"
#echo "Copying log4j2.xml"
cp -a /opt/solr/server/resources/log4j2.xml "$DIR/log4j2.xml"
fi

View File

@ -15,9 +15,6 @@ if [[ "${VERBOSE:-}" == "yes" ]]; then
set -x
fi
# init script for handling an empty /var/solr
/opt/docker-solr/scripts/init-var-solr
. /opt/docker-solr/scripts/run-initdb
# solr uses "-c corename". Parse the arguments to determine the core name.

View File

@ -7,9 +7,6 @@ if [[ "$VERBOSE" == "yes" ]]; then
set -x
fi
# init script for handling an empty /var/solr
/opt/docker-solr/scripts/init-var-solr
. /opt/docker-solr/scripts/run-initdb
exec solr-fg "$@"

View File

@ -17,9 +17,6 @@ if [[ "${VERBOSE:-}" == "yes" ]]; then
set -x
fi
# init script for handling an empty /var/solr
/opt/docker-solr/scripts/init-var-solr
. /opt/docker-solr/scripts/run-initdb
/opt/docker-solr/scripts/precreate-core "$@"

View File

@ -17,6 +17,7 @@ docker volume create "$myvarsolr"
docker run \
-v "$myvarsolr:/var/solr:nocopy" \
--rm \
-e NO_INIT_VAR_SOLR=yes \
-u "0:0" \
"$tag" bash -c "chown 8983:8983 /var/solr"