From 6b76c06ea41c347da2daa08c1a11106b6569151b Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 20 Jul 2016 19:48:58 +0100 Subject: [PATCH 1/5] rebase to xenial --- Dockerfile | 39 ++++++++++++++++++++-------------- README.md | 8 +++---- init/30_cleanpid.sh | 2 -- init/95_optnzbdrone_fix.sh | 3 --- root/etc/cont-init.d/30-config | 8 +++++++ root/etc/services.d/sonarr/run | 5 +++++ services/sonarr/run | 3 --- 7 files changed, 40 insertions(+), 28 deletions(-) delete mode 100644 init/30_cleanpid.sh delete mode 100644 init/95_optnzbdrone_fix.sh create mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/services.d/sonarr/run delete mode 100644 services/sonarr/run diff --git a/Dockerfile b/Dockerfile index 9ff4156..4d92435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,30 @@ -FROM linuxserver/baseimage -MAINTAINER Stian Larsen +FROM lsiobase/xenial +MAINTAINER sparklyballs -ENV APTLIST="libmono-cil-dev python nzbdrone" +# set environment variables +ARG DEBIAN_FRONTEND="noninteractive" -# Configure nzbdrone's apt repository -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC && \ -echo "deb http://apt.sonarr.tv/ master main" > /etc/apt/sources.list.d/sonarr.list && \ -apt-get update -q && \ -apt-get install $APTLIST -qy && \ -apt-get clean && \ -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +# add sonarr repository +RUN \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC && \ + echo "deb http://apt.sonarr.tv/ master main" > \ + /etc/apt/sources.list.d/sonarr.list && \ +# install packages + apt-get update && \ + apt-get install -y \ + nzbdrone && \ -#Adding Custom files -ADD init/ /etc/my_init.d/ -ADD services/ /etc/service/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh - +# cleanup + apt-get clean && \ + rm -rfv \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* -#Ports and Volumes +# add local files +COPY root/ / + +# ports and volumes VOLUME /config /downloads /tv EXPOSE 8989 diff --git a/README.md b/README.md index 368776d..58f7ebf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -The [LinuxServer.io](https://linuxserver.io) team brings you another quality container release featuring auto-update on startup, easy user mapping and community support. Be sure to checkout our [forums](https://forum.linuxserver.io) or for real-time support our [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. +The [LinuxServer.io](https://linuxserver.io) team brings you another quality container release featuring easy user mapping and community support. Be sure to checkout our [forums](https://forum.linuxserver.io) or for real-time support our [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. # linuxserver/sonarr @@ -37,11 +37,11 @@ docker create \ Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers. -## Updates / Monitoring +## Info -* Upgrade to the latest version of sonarr simply `docker restart sonarr`. * Monitor the logs of the container in realtime `docker logs -f sonarr`. ## Changelog -+ **31.08.2015:** Cleanup, changed sources to fetch binarys from. also a new baseimage. ++ **20.07.16:** Rebase to xenial. ++ **31.08.15:** Cleanup, changed sources to fetch binarys from. also a new baseimage. diff --git a/init/30_cleanpid.sh b/init/30_cleanpid.sh deleted file mode 100644 index 7ec312d..0000000 --- a/init/30_cleanpid.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -if [ -f /config/nzbdrone.pid ]; then rm -r /config/nzbdrone.pid; fi diff --git a/init/95_optnzbdrone_fix.sh b/init/95_optnzbdrone_fix.sh deleted file mode 100644 index 6387d5b..0000000 --- a/init/95_optnzbdrone_fix.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -chown -R abc:abc /opt/NzbDrone diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..e7ae5bb --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,8 @@ +#!/usr/bin/with-contenv bash + +# cleanup pid if it exists +[[ -e /config/nzbdrone.pid ]] && rm -rf /config/nzbdrone.pid + +# permissions +chown -R abc:abc /opt/NzbDrone + diff --git a/root/etc/services.d/sonarr/run b/root/etc/services.d/sonarr/run new file mode 100644 index 0000000..4b2d969 --- /dev/null +++ b/root/etc/services.d/sonarr/run @@ -0,0 +1,5 @@ +#!/usr/bin/with-contenv bash + +umask 0002 + +XDG_CONFIG_HOME="/config/xdg" exec s6-setuidgid abc mono /opt/NzbDrone/NzbDrone.exe -nobrowser -data=/config diff --git a/services/sonarr/run b/services/sonarr/run deleted file mode 100644 index 77086cc..0000000 --- a/services/sonarr/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -umask 0002 -XDG_CONFIG_HOME="/config/xdg" exec /sbin/setuser abc mono /opt/NzbDrone/NzbDrone.exe -nobrowser -data=/config From e2c5c51a267096b095cbb00f144f6a600dcfd72a Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 20 Jul 2016 19:54:42 +0100 Subject: [PATCH 2/5] bring README into this century, lol --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 58f7ebf..e93650c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ ![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -The [LinuxServer.io](https://linuxserver.io) team brings you another quality container release featuring easy user mapping and community support. Be sure to checkout our [forums](https://forum.linuxserver.io) or for real-time support our [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. +The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io](https://forum.linuxserver.io) +* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` +* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! # linuxserver/sonarr @@ -18,7 +21,7 @@ docker create \ -v /dev/rtc:/dev/rtc:ro \ -v :/config \ -v :/tv \ - -v :/downloads \ + -v :/downloads \ linuxserver/sonarr ``` @@ -31,11 +34,18 @@ docker create \ * `-e PGID` for for GroupID - see below for explanation * `-e PUID` for for UserID - see below for explanation +It is based on ubuntu xenial with S6 overlay, for shell access whilst the container is running do `docker exec -it musicbrainz /bin/bash`. + ### User / Group Identifiers -**TL;DR** - The `PGID` and `PUID` values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended). +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" TM. -Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers. +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: + +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` ## Info From ae97e6ae61ce74030550007cd6a732757e9687e9 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 20 Jul 2016 19:56:31 +0100 Subject: [PATCH 3/5] fix spelling and copy pasta error --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e93650c..d9228a9 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ docker create \ **Parameters** * `-p 8989` - the port sonarr webinterface -* `-v /dev/rtc:/dev/rtc:ro` - map hwclock to the docker hwclock as ReadOnly (mono throws exeptions otherwise) +* `-v /dev/rtc:/dev/rtc:ro` - map hwclock to the docker hwclock as ReadOnly (mono throws exceptions otherwise) * `-v /config` - database and sonarr configs * `-v /tv` - location of TV library on disk * `-e PGID` for for GroupID - see below for explanation * `-e PUID` for for UserID - see below for explanation -It is based on ubuntu xenial with S6 overlay, for shell access whilst the container is running do `docker exec -it musicbrainz /bin/bash`. +It is based on ubuntu xenial with S6 overlay, for shell access whilst the container is running do `docker exec -it sonarr /bin/bash`. ### User / Group Identifiers From 6b570ac18ea0de8733135a39d15b5aa06fee563d Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 20 Jul 2016 19:57:30 +0100 Subject: [PATCH 4/5] fix line overflow README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9228a9..c779614 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ docker create \ **Parameters** * `-p 8989` - the port sonarr webinterface -* `-v /dev/rtc:/dev/rtc:ro` - map hwclock to the docker hwclock as ReadOnly (mono throws exceptions otherwise) +* `-v /dev/rtc:/dev/rtc:ro` - map hwclock as ReadOnly (mono throws exceptions otherwise) * `-v /config` - database and sonarr configs * `-v /tv` - location of TV library on disk * `-e PGID` for for GroupID - see below for explanation From 4067f7e7e743cb07d234f25122fe84ed1df8daf6 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 20 Jul 2016 20:00:15 +0100 Subject: [PATCH 5/5] remove old dev crud --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64760b6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -sudo: false -addons: - apt: - sources: - - debian-sid - packages: - - shellcheck -script: - - shellcheck --version - - find . -type f -name '*.sh' | while read file; do echo "Linting $file"; shellcheck $file || exit 1; done