Public Repository

Last pushed: 6 months ago
Short Description
Short description is empty for this repo.
Full Description

Full description is empty for this repo.

Docker Pull Command
Owner
sekhrivijay

Comments (1)
sekhrivijay
6 months ago

FROM openjdk:8-jre-alpine
MAINTAINER Martijn Koster "mak-docker@greenhills.co.uk"

Override the solr download location with e.g.:

docker build -t mine --build-arg SOLR_DOWNLOAD_SERVER=http://www-eu.apache.org/dist/lucene/solr .

ARG SOLR_DOWNLOAD_SERVER

Override the GPG keyserver with e.g.:

docker build -t mine --build-arg GPG_KEYSERVER=hkp://eu.pool.sks-keyservers.net .

ARG GPG_KEYSERVER

RUN apk add --no-cache \
lsof \
gnupg \
procps \
tar \
bash
RUN apk add --no-cache ca-certificates wget && \
update-ca-certificates

ENV SOLR_USER solr
ENV SOLR_UID 8983

RUN addgroup -S -g $SOLR_UID $SOLR_USER && \
adduser -S -u $SOLR_UID -g $SOLR_USER $SOLR_USER

ENV SOLR_KEY 38D2EA16DDF5FC722EBC433FDC92616F177050F6
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$SOLR_KEY"
ENV GPG_KEYSERVER ${GPG_KEYSERVER:-hkp://ha.pool.sks-keyservers.net}
RUN gpg --keyserver "$GPG_KEYSERVER" --recv-keys "$SOLR_KEY"

ENV SOLR_VERSION 6.1.0
ENV SOLR_SHA256 41045799ed9b5f826b0dcab4b28b3b1986afa523
ENV SOLR_URL ${SOLR_DOWNLOAD_SERVER:-https://archive.apache.org/dist/lucene/solr}/$SOLR_VERSION/solr-$SOLR_VERSION.tgz

RUN mkdir -p /opt/solr && \
echo "downloading $SOLR_URL" && \
wget -q $SOLR_URL -O /opt/solr.tgz && \
echo "downloading $SOLR_URL.asc" && \
wget -q $SOLR_URL.asc -O /opt/solr.tgz.asc && \

echo "$SOLR_SHA256 */opt/solr.tgz" | sha256sum -c - && \

(>&2 ls -l /opt/solr.tgz /opt/solr.tgz.asc) && \

gpg --batch --verify /opt/solr.tgz.asc /opt/solr.tgz && \

tar -C /opt/solr --extract --file /opt/solr.tgz --strip-components=1 && \
rm /opt/solr.tgz* && \
rm -Rf /opt/solr/docs/ && \
mkdir -p /opt/solr/server/solr/lib /opt/solr/server/solr/mycores && \
sed -i -e 's/#SOLR_PORT=8983/SOLR_PORT=8983/' /opt/solr/bin/solr.in.sh && \
sed -i -e '/-Dsolr.clustering.enabled=true/ a SOLR_OPTS="$SOLR_OPTS -Dsun.net.inetaddr.ttl=60 -Dsun.net.inetaddr.negative.ttl=60"' /opt/solr/bin/solr.in.sh && \
chown -R $SOLR_USER:$SOLR_USER /opt/solr && \
mkdir /docker-entrypoint-initdb.d /opt/docker-solr/

COPY scripts /opt/docker-solr/scripts
RUN chown -R $SOLR_USER:$SOLR_USER /opt/docker-solr

ENV PATH /opt/solr/bin:/opt/docker-solr/scripts:$PATH

EXPOSE 8983
WORKDIR /opt/solr
USER $SOLR_USER

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["solr-foreground"]