first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
13
base/solr/7.0.1/Dockerfile
Normal file
13
base/solr/7.0.1/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM openjdk:8u342-jdk
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
RUN set -ex \
|
||||
&& mkdir -p /opt/solr \
|
||||
&& wget --no-check-certificate -qO- https://archive.apache.org/dist/lucene/solr/7.0.1/solr-7.0.1.tgz | tar xz --strip-components=1 -C /opt/solr
|
||||
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
ENV PATH="$PATH:/opt/solr/bin"
|
||||
WORKDIR /opt/solr
|
||||
ENTRYPOINT [ "bash", "/docker-entrypoint.sh" ]
|
||||
CMD ["solr", "-f", "-force", "-p", "8983", "-a", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"]
|
41
base/solr/7.0.1/docker-entrypoint.sh
Normal file
41
base/solr/7.0.1/docker-entrypoint.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
CORE="demo"
|
||||
coresdir=/opt/solr/server/solr
|
||||
CORE_DIR="$coresdir/$CORE"
|
||||
|
||||
if [ -d "$CORE_DIR" ]; then
|
||||
echo "$CORE_DIR exists; skipping core creation"
|
||||
else
|
||||
# start Solr background
|
||||
SOLR_OPTS="-Djetty.host=localhost" solr start -force -p 8983
|
||||
# wait for Solr startup
|
||||
while ! wget -qO- http://localhost:8983 | grep -i solr >/dev/null; do
|
||||
echo "waiting for Apache Solr ready..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
||||
echo "Creating $CORE"
|
||||
solr create_core -force -c "$CORE" -d example/example-DIH/solr/db
|
||||
echo "Created $CORE"
|
||||
echo "Loading example data"
|
||||
|
||||
post -c $CORE -commit no example/exampledocs/*.xml
|
||||
post -c $CORE -commit no example/exampledocs/books.json
|
||||
post -c $CORE -commit yes example/exampledocs/books.csv
|
||||
|
||||
echo "Loaded example data"
|
||||
# check the core_dir exists; otherwise the detecting above will fail after stop/start
|
||||
if [ ! -d "$CORE_DIR" ]; then
|
||||
echo "Missing $CORE_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# stop Solr background
|
||||
SOLR_OPTS="-Djetty.host=localhost" solr stop -force -p 8983
|
||||
fi
|
||||
|
||||
exec "$@"
|
Reference in New Issue
Block a user