Move Solr to /opt and create separate UID/GID
This commit is contained in:
parent
86f9b8cae1
commit
cfdbb2c609
1
solr.sh
1
solr.sh
@ -8,6 +8,7 @@ docker build -t solr ${SOURCE_DIR}
|
|||||||
# Configure Solr
|
# Configure Solr
|
||||||
mkdir -p /srv/solr/data
|
mkdir -p /srv/solr/data
|
||||||
cp ${SOURCE_DIR}/srv/solr/data/solr.xml /srv/solr/data/solr.xml
|
cp ${SOURCE_DIR}/srv/solr/data/solr.xml /srv/solr/data/solr.xml
|
||||||
|
chown -R 8983:8983 /srv/solr/data
|
||||||
|
|
||||||
# Configure Solr service
|
# Configure Solr service
|
||||||
cp ${SOURCE_DIR}/lib/systemd/system/solr.service /lib/systemd/system/solr.service
|
cp ${SOURCE_DIR}/lib/systemd/system/solr.service /lib/systemd/system/solr.service
|
||||||
|
@ -5,16 +5,18 @@ RUN apk --no-cache add openjdk8-jre-base
|
|||||||
|
|
||||||
RUN apk --no-cache add bash lsof \
|
RUN apk --no-cache add bash lsof \
|
||||||
&& wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz \
|
&& wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz \
|
||||||
&& tar xzf /tmp/solr-6.5.1.tgz -C /srv/ \
|
&& mkdir /opt \
|
||||||
&& mv /srv/solr-6.5.1 /srv/solr \
|
&& tar xzf /tmp/solr-6.5.1.tgz -C /opt/ \
|
||||||
|
&& mv /opt/solr-6.5.1 /opt/solr \
|
||||||
&& rm -f /tmp/solr-6.5.1.tgz \
|
&& rm -f /tmp/solr-6.5.1.tgz \
|
||||||
&& addgroup -S solr \
|
&& addgroup -S -g 8983 solr \
|
||||||
&& adduser -S -h /srv/solr -H -s /bin/sh -g solr -G solr solr \
|
&& adduser -S -u 8983 -h /var/lib/solr -s /bin/sh -g solr -G solr solr \
|
||||||
&& chown -R solr:solr /srv/solr/ \
|
&& chown -R solr:solr /opt/solr/ \
|
||||||
&& ln -s /srv/solr/bin/solr /usr/local/bin/solr
|
&& cp -p /opt/solr/server/solr/solr.xml /var/lib/solr/solr.xml \
|
||||||
|
&& ln -s /opt/solr/bin/solr /usr/local/bin/solr
|
||||||
|
|
||||||
VOLUME ["/srv/solr/server/solr"]
|
VOLUME ["/var/lib/solr"]
|
||||||
EXPOSE 8983
|
EXPOSE 8983
|
||||||
|
|
||||||
USER solr
|
USER solr
|
||||||
CMD ["solr", "start", "-f"]
|
CMD ["solr", "start", "-f", "-s", "/var/lib/solr"]
|
||||||
|
@ -4,7 +4,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/docker run --rm --tmpfs /tmp --name solr -v /srv/solr/data:/srv/solr/server/solr solr
|
ExecStart=/usr/bin/docker run --rm --tmpfs /tmp --name solr -v /srv/solr/data:/var/lib/solr solr
|
||||||
ExecStop=/usr/bin/docker stop solr
|
ExecStop=/usr/bin/docker stop solr
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
Loading…
Reference in New Issue
Block a user