This repository has been archived by the owner on Nov 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
44 lines (36 loc) · 1.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM openjdk:8-jre
RUN apt-get update && \
apt-get -y install lsof procps wget gpg && \
rm -rf /var/lib/apt/lists/*
ENV SOLR_USER="solr" \
SOLR_UID="8983" \
SOLR_GROUP="solr" \
SOLR_GID="8983" \
SOLR_VERSION="4.10.4" \
SOLR_URL="${SOLR_DOWNLOAD_SERVER:-https://archive.apache.org/dist/lucene/solr}/4.10.4/solr-4.10.4.tgz" \
SOLR_SHA256="ac3543880f1b591bcaa962d7508b528d7b42e2b5548386197940b704629ae851" \
PATH="/opt/solr/bin:/opt/docker-solr/scripts:$PATH"
RUN groupadd -r --gid $SOLR_GID $SOLR_GROUP && \
useradd -r --uid $SOLR_UID --gid $SOLR_GID $SOLR_USER
RUN mkdir -p /opt/solr && \
echo "downloading $SOLR_URL" && \
wget -nv $SOLR_URL -O /opt/solr.tgz && \
echo "downloading $SOLR_URL.asc" && \
wget -nv $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) && \
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 /opt/solr/server/logs /docker-entrypoint-initdb.d /opt/docker-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 && \
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_GROUP /opt/solr
COPY scripts /opt/docker-solr/scripts
RUN chown -R $SOLR_USER:$SOLR_GROUP /opt/docker-solr
EXPOSE 8983
WORKDIR /opt/solr
USER $SOLR_USER
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["solr-foreground"]