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 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..c779614 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 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 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,30 +21,37 @@ docker create \ -v /dev/rtc:/dev/rtc:ro \ -v :/config \ -v :/tv \ - -v :/downloads \ + -v :/downloads \ linuxserver/sonarr ``` **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 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 sonarr /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: -## Updates / Monitoring +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` + +## 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