From 8733cb8b301b1b5292297ebb7c90d56fa1c376d3 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 19 Dec 2017 16:31:35 +0100 Subject: [PATCH] Alpinize Solr --- solr.sh | 7 +++---- solr/Dockerfile | 5 ++++- solr/etc/init.d/solr | 16 ++++++++++++++++ solr/lib/systemd/system/solr.service | 11 ----------- 4 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 solr/etc/init.d/solr delete mode 100644 solr/lib/systemd/system/solr.service diff --git a/solr.sh b/solr.sh index 6b13061..e2716b2 100755 --- a/solr.sh +++ b/solr.sh @@ -11,7 +11,6 @@ cp ${SOURCE_DIR}/srv/solr/data/solr.xml /srv/solr/data/solr.xml chown -R 8983:8983 /srv/solr/data # Configure Solr service -cp ${SOURCE_DIR}/lib/systemd/system/solr.service /lib/systemd/system/solr.service -systemctl daemon-reload -systemctl enable solr -systemctl start solr +cp ${SOURCE_DIR}/etc/init.d/solr /etc/init.d/solr +rc-update add solr boot +service solr start diff --git a/solr/Dockerfile b/solr/Dockerfile index 38d6be6..6f934e5 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,7 +1,10 @@ FROM alpine:3.7 MAINTAINER Disassembler -RUN apk --no-cache add openjdk8-jre-base +RUN apk --no-cache add openjdk8-jre-base paxctl \ + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \ + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \ + && apk del paxctl 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 \ diff --git a/solr/etc/init.d/solr b/solr/etc/init.d/solr new file mode 100644 index 0000000..639c7bb --- /dev/null +++ b/solr/etc/init.d/solr @@ -0,0 +1,16 @@ +#!/sbin/openrc-run + +description="Solr docker container" + +depend() { + need docker net + use dns logger netmount +} + +start() { + /usr/bin/docker run -d --rm --name solr -v /srv/solr/data:/var/lib/solr solr +} + +stop() { + /usr/bin/docker stop solr +} diff --git a/solr/lib/systemd/system/solr.service b/solr/lib/systemd/system/solr.service deleted file mode 100644 index 7225638..0000000 --- a/solr/lib/systemd/system/solr.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Solr Docker container -After=network.target - -[Service] -Type=simple -ExecStart=/usr/bin/docker run --rm --name solr -v /srv/solr/data:/var/lib/solr solr -ExecStop=/usr/bin/docker stop solr - -[Install] -WantedBy=multi-user.target