lucene/solr/docker/scripts/docker-entrypoint.sh
Houston Putman 2b8d7bcd6a
SOLR-15075: Solr docker gradle improvements (#2197)
* Removed docker plugin from gradle builds.
* Removed package docker image.
* Tasks now have correct inputs/outputs/dependencies.
* Move gradle help text to docker folder.
* Reduce duplicated Docker layer by doing file removal and chmod in another stage.

Co-authored-by: David Smiley <dsmiley@apache.org>
2021-01-26 10:22:50 -05:00

35 lines
924 B
Bash
Executable File

#!/bin/bash
#
# docker-entrypoint for Solr docker
set -e
# Clear some variables that we don't want runtime
unset SOLR_USER SOLR_UID SOLR_GROUP SOLR_GID \
SOLR_CLOSER_URL SOLR_DIST_URL SOLR_ARCHIVE_URL SOLR_DOWNLOAD_URL SOLR_DOWNLOAD_SERVER SOLR_KEYS SOLR_SHA512
if [[ "$VERBOSE" == "yes" ]]; then
set -x
fi
if ! [[ ${SOLR_PORT:-} =~ ^[0-9]+$ ]]; then
SOLR_PORT=8983
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 "$@"
fi
# execute command passed in as arguments.
# The Dockerfile has specified the PATH to include
# /opt/solr/bin (for Solr) and /opt/docker-solr/scripts (for our scripts
# like solr-foreground, solr-create, solr-precreate, solr-demo).
# Note: if you specify "solr", you'll typically want to add -f to run it in
# the foreground.
exec "$@"