forked from Sitecore/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (29 loc) · 918 Bytes
/
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
ARG BASE_IMAGE
FROM $BASE_IMAGE as builder
ARG CORE_NAMES
COPY managed-schema /opt/
USER root
RUN set -e; \
CORES_DIR='/opt/solr/server/solr'; \
ORIG_IFS=${IFS}; \
IFS=', '; \
for core in ${CORE_NAMES}; do \
echo "Creating '$CORES_DIR/$core'..."; \
cp -r /opt/solr/server/solr/configsets/_default/ $CORES_DIR/$core; \
cp /opt/managed-schema $CORES_DIR/$core/conf/managed-schema; \
touch "$CORES_DIR/$core/core.properties"; \
done; \
IFS=${ORIG_IFS};
FROM $BASE_IMAGE
COPY --from=builder ["/opt/solr/server/solr", "/clean"]
COPY boot.sh /opt/boot.sh
USER root
RUN chmod +x /opt/boot.sh && \
chown -R $SOLR_USER:$SOLR_USER /clean && \
chmod -R 700 /clean && \
mkdir -p /data && \
chown -R $SOLR_USER:$SOLR_USER /data && \
chmod -R 700 /data
USER $SOLR_USER
ENV SOLR_HOME=/data
ENTRYPOINT ["/opt/boot.sh", "/clean", "/data"]