From ee059ef20137f7c8f0b6d95744b9d98d46b74ecb Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Sun, 7 Aug 2016 00:51:20 +0100 Subject: [PATCH] tidy up init and services files --- Dockerfile | 33 ++++++++++++++++++--------------- root/etc/cont-init.d/20-config | 11 ++++++++--- root/etc/services.d/sabnzbd/run | 4 +++- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 133a498..2db3370 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,27 @@ FROM lsiobase/alpine.python MAINTAINER sparklyballs +# install sabnzbd +RUN \ + mkdir -p \ + /app/sabnzbd && \ + LATEST_RELEASE=$(curl -sX GET "https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest" | \ + awk '/tag_name/{print $4;exit}' FS='[""]') && \ + curl -o \ + /tmp/sabnzbd.tar.gz -L \ + https://github.com/sabnzbd/sabnzbd/releases/download/"${LATEST_RELEASE}"/SABnzbd-"${LATEST_RELEASE}"-src.tar.gz && \ + + tar xf \ + /tmp/sabnzbd.tar.gz -C \ + /app/sabnzbd --strip-components=1 && \ + +# cleanup + rm -f \ + /tmp/* + # add local files COPY root/ / -# install sabnzbd -RUN \ - mkdir -p /app/sabnzbd && \ - LATEST_RELEASE=$(curl -sX GET "https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest" | \ - awk '/tag_name/{print $4;exit}' FS='[""]') && \ - curl -o \ - /tmp/sabnzbd.tar.gz -L \ - https://github.com/sabnzbd/sabnzbd/releases/download/"${LATEST_RELEASE}"/SABnzbd-"${LATEST_RELEASE}"-src.tar.gz && \ - - tar xf /tmp/sabnzbd.tar.gz -C \ - /app/sabnzbd --strip-components=1 && \ - -# cleanup - rm -f /tmp/* - # ports and volumes VOLUME /config /downloads /incomplete-downloads EXPOSE 8080 9090 diff --git a/root/etc/cont-init.d/20-config b/root/etc/cont-init.d/20-config index 4f17d04..1d6987f 100644 --- a/root/etc/cont-init.d/20-config +++ b/root/etc/cont-init.d/20-config @@ -1,8 +1,13 @@ #!/usr/bin/with-contenv bash # make folders -mkdir -p /downloads /incomplete-downloads +mkdir -p \ + /downloads \ + /incomplete-downloads # permissions -chown -R abc:abc /app/sabnzbd -chown abc:abc /downloads /incomplete-downloads +chown -R abc:abc \ + /app/sabnzbd +chown abc:abc \ + /downloads \ + /incomplete-downloads diff --git a/root/etc/services.d/sabnzbd/run b/root/etc/services.d/sabnzbd/run index a8a1be2..a421b75 100644 --- a/root/etc/services.d/sabnzbd/run +++ b/root/etc/services.d/sabnzbd/run @@ -1,3 +1,5 @@ #!/usr/bin/with-contenv bash -s6-setuidgid abc python /app/sabnzbd/SABnzbd.py -f /config/sabnzbd.ini -b 0 -s 0.0.0.0:8080 +exec \ + s6-setuidgid abc python /app/sabnzbd/SABnzbd.py \ + -f /config/sabnzbd.ini -b 0 -s 0.0.0.0:8080