diff --git a/Dockerfile b/Dockerfile index 16f1245..cb87126 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,27 +13,27 @@ ENV XDG_CONFIG_HOME="/config/xdg" ENV SONARR_BRANCH="main" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y \ + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install -y \ jq && \ - echo "**** install sonarr ****" && \ - mkdir -p /app/sonarr/bin && \ - if [ -z ${SONARR_VERSION+x} ]; then \ - SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \ - | jq -r ".[] | select(.branch==\"$SONARR_BRANCH\") | .version"); \ - fi && \ - curl -o \ + echo "**** install sonarr ****" && \ + mkdir -p /app/sonarr/bin && \ + if [ -z ${SONARR_VERSION+x} ]; then \ + SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \ + | jq -r ".[] | select(.branch==\"$SONARR_BRANCH\") | .version"); \ + fi && \ + curl -o \ /tmp/sonarr.tar.gz -L \ "https://download.sonarr.tv/v3/${SONARR_BRANCH}/${SONARR_VERSION}/Sonarr.${SONARR_BRANCH}.${SONARR_VERSION}.linux.tar.gz" && \ - tar xf \ + tar xf \ /tmp/sonarr.tar.gz -C \ /app/sonarr/bin --strip-components=1 && \ - echo "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \ - rm -rf /app/sonarr/bin/Sonarr.Update && \ - echo "**** cleanup ****" && \ - apt-get clean && \ - rm -rf \ + echo "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \ + rm -rf /app/sonarr/bin/Sonarr.Update && \ + echo "**** cleanup ****" && \ + apt-get clean && \ + rm -rf \ /tmp/* \ /var/tmp/* diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e416a79..444be04 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -13,27 +13,27 @@ ENV XDG_CONFIG_HOME="/config/xdg" ENV SONARR_BRANCH="main" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y \ + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install -y \ jq && \ - echo "**** install sonarr ****" && \ - mkdir -p /app/sonarr/bin && \ - if [ -z ${SONARR_VERSION+x} ]; then \ - SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \ - | jq -r ".[] | select(.branch==\"$SONARR_BRANCH\") | .version"); \ - fi && \ - curl -o \ + echo "**** install sonarr ****" && \ + mkdir -p /app/sonarr/bin && \ + if [ -z ${SONARR_VERSION+x} ]; then \ + SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \ + | jq -r ".[] | select(.branch==\"$SONARR_BRANCH\") | .version"); \ + fi && \ + curl -o \ /tmp/sonarr.tar.gz -L \ "https://download.sonarr.tv/v3/${SONARR_BRANCH}/${SONARR_VERSION}/Sonarr.${SONARR_BRANCH}.${SONARR_VERSION}.linux.tar.gz" && \ - tar xf \ + tar xf \ /tmp/sonarr.tar.gz -C \ /app/sonarr/bin --strip-components=1 && \ - echo "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \ - rm -rf /app/sonarr/bin/Sonarr.Update && \ - echo "**** cleanup ****" && \ - apt-get clean && \ - rm -rf \ + echo "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \ + rm -rf /app/sonarr/bin/Sonarr.Update && \ + echo "**** cleanup ****" && \ + apt-get clean && \ + rm -rf \ /tmp/* \ /var/tmp/* diff --git a/Dockerfile.armhf b/Dockerfile.armhf index b1eea7a..f0051f7 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -13,27 +13,27 @@ ENV XDG_CONFIG_HOME="/config/xdg" ENV SONARR_BRANCH="main" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y \ + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install -y \ jq && \ - echo "**** install sonarr ****" && \ - mkdir -p /app/sonarr/bin && \ - if [ -z ${SONARR_VERSION+x} ]; then \ - SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \ - | jq -r ".[] | select(.branch==\"$SONARR_BRANCH\") | .version"); \ - fi && \ - curl -o \ + echo "**** install sonarr ****" && \ + mkdir -p /app/sonarr/bin && \ + if [ -z ${SONARR_VERSION+x} ]; then \ + SONARR_VERSION=$(curl -sX GET http://services.sonarr.tv/v1/releases \ + | jq -r ".[] | select(.branch==\"$SONARR_BRANCH\") | .version"); \ + fi && \ + curl -o \ /tmp/sonarr.tar.gz -L \ "https://download.sonarr.tv/v3/${SONARR_BRANCH}/${SONARR_VERSION}/Sonarr.${SONARR_BRANCH}.${SONARR_VERSION}.linux.tar.gz" && \ - tar xf \ + tar xf \ /tmp/sonarr.tar.gz -C \ /app/sonarr/bin --strip-components=1 && \ - echo "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \ - rm -rf /app/sonarr/bin/Sonarr.Update && \ - echo "**** cleanup ****" && \ - apt-get clean && \ - rm -rf \ + echo "UpdateMethod=docker\nBranch=${SONARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/sonarr/package_info && \ + rm -rf /app/sonarr/bin/Sonarr.Update && \ + echo "**** cleanup ****" && \ + apt-get clean && \ + rm -rf \ /tmp/* \ /var/tmp/* diff --git a/README.md b/README.md index 13a7e00..63cf446 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,13 @@ This image provides various versions that are available via tags. `latest` tag u Access the webui at `:8989`, for more information check out [Sonarr](https://sonarr.tv/). -Special Note: Following our current folder structure will result in an inability to hardlink from your downloads to your TV folder because they are on seperate volumes. To support hardlinking, simply ensure that the TV and downloads data are on a single volume. For example, if you have /mnt/storage/TV and /mnt/storage/downloads/completed/TV, you would want something like /mnt/storage:/media for your volume. Then you can hardlink from /media/downloads/completed to /media/TV. +### Media folders -Another item to keep in mind, is that within sonarr itself, you should then map your torrent client folder to your sonarr folder: Settings -> Download Client -> advanced -> remote path mappings. I input the host of my download client (matches the download client defined) remote path is /downloads/TV (relative to the internal container path) and local path is /media/downloads/completed/TV, assuming you have folders to seperate your downloaded data types. +We have set `/tv` and `/downloads` as ***optional paths***, this is because it is the easiest way to get started. While easy to use, it has some drawbacks. Mainly losing the ability to hardlink (TL;DR a way for a file to exist in multiple places on the same file system while only consuming one file worth of space), or atomic move (TL;DR instant file moves, rather than copy+delete) files while processing content. + +Use the optional paths if you dont understand, or dont want hardlinks/atomic moves. + +The folks over at servarr.com wrote a good [write-up](https://wiki.servarr.com/Docker_Guide#Consistent_and_well_planned_paths) on how to get started with this. ## Usage @@ -97,8 +101,8 @@ services: - TZ=Europe/London volumes: - /path/to/data:/config - - /path/to/tvseries:/tv - - /path/to/downloadclient-downloads:/downloads + - /path/to/tvseries:/tv #optional + - /path/to/downloadclient-downloads:/downloads #optional ports: - 8989:8989 restart: unless-stopped @@ -114,8 +118,8 @@ docker run -d \ -e TZ=Europe/London \ -p 8989:8989 \ -v /path/to/data:/config \ - -v /path/to/tvseries:/tv \ - -v /path/to/downloadclient-downloads:/downloads \ + -v /path/to/tvseries:/tv `#optional` \ + -v /path/to/downloadclient-downloads:/downloads `#optional` \ --restart unless-stopped \ ghcr.io/linuxserver/sonarr ``` @@ -243,6 +247,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **11.05.21:** - Make the paths clearer to the user. * **10.03.21:** - Upgrade to Sonarr v3. Existing users are highly recommended to make a backup prior to update. * **18.01.21:** - Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information. * **05.04.20:** - Move app to /app. diff --git a/readme-vars.yml b/readme-vars.yml index 676d869..8ae2666 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -27,6 +27,9 @@ param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - { vol_path: "/config", vol_host_path: "/path/to/data", desc: "Database and sonarr configs" } + +opt_param_usage_include_vols: true +opt_param_volumes: - { vol_path: "/tv", vol_host_path: "/path/to/tvseries", desc: "Location of TV library on disk (See note in Application setup)" } - { vol_path: "/downloads", vol_host_path: "/path/to/downloadclient-downloads", desc: "Location of download managers output directory (See note in Application setup)" } @@ -44,12 +47,18 @@ app_setup_block_enabled: true app_setup_block: | Access the webui at `:8989`, for more information check out [Sonarr](https://sonarr.tv/). - Special Note: Following our current folder structure will result in an inability to hardlink from your downloads to your TV folder because they are on seperate volumes. To support hardlinking, simply ensure that the TV and downloads data are on a single volume. For example, if you have /mnt/storage/TV and /mnt/storage/downloads/completed/TV, you would want something like /mnt/storage:/media for your volume. Then you can hardlink from /media/downloads/completed to /media/TV. + ### Media folders + + We have set `/tv` and `/downloads` as ***optional paths***, this is because it is the easiest way to get started. While easy to use, it has some drawbacks. Mainly losing the ability to hardlink (TL;DR a way for a file to exist in multiple places on the same file system while only consuming one file worth of space), or atomic move (TL;DR instant file moves, rather than copy+delete) files while processing content. + + Use the optional paths if you dont understand, or dont want hardlinks/atomic moves. + + The folks over at servarr.com wrote a good [write-up](https://wiki.servarr.com/Docker_Guide#Consistent_and_well_planned_paths) on how to get started with this. - Another item to keep in mind, is that within sonarr itself, you should then map your torrent client folder to your sonarr folder: Settings -> Download Client -> advanced -> remote path mappings. I input the host of my download client (matches the download client defined) remote path is /downloads/TV (relative to the internal container path) and local path is /media/downloads/completed/TV, assuming you have folders to seperate your downloaded data types. # changelog changelogs: + - { date: "11.05.21:", desc: "Make the paths clearer to the user." } - { date: "10.03.21:", desc: "Upgrade to Sonarr v3. Existing users are highly recommended to make a backup prior to update." } - { date: "18.01.21:", desc: "Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information." } - { date: "05.04.20:", desc: "Move app to /app." } diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 368f9ef..9010fc3 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -2,8 +2,8 @@ # cleanup pid if it exists [[ -e /config/sonarr.pid ]] && \ - rm -rf /config/sonarr.pid + rm -rf /config/sonarr.pid # permissions chown -R abc:abc \ - /app/sonarr/bin + /app/sonarr/bin diff --git a/root/etc/services.d/sonarr/run b/root/etc/services.d/sonarr/run index b519d99..a81aa25 100644 --- a/root/etc/services.d/sonarr/run +++ b/root/etc/services.d/sonarr/run @@ -1,12 +1,12 @@ #!/usr/bin/with-contenv bash if [ -n "${UMASK_SET}" ] && [ -z "${UMASK}" ]; then - echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021" - umask ${UMASK_SET} + echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021" + umask ${UMASK_SET} fi cd /app/sonarr/bin || exit exec \ - s6-setuidgid abc mono --debug Sonarr.exe \ - -nobrowser -data=/config + s6-setuidgid abc mono --debug Sonarr.exe \ + -nobrowser -data=/config