From 26b07afc797b3c98f77b68d76086dacc2db131d3 Mon Sep 17 00:00:00 2001 From: Roxedus Date: Mon, 12 Jul 2021 00:48:40 +0200 Subject: [PATCH] Use runtime when checking for updates. --- .github/workflows/external_trigger.yml | 2 +- Dockerfile | 52 +++++++++++++------------- Dockerfile.aarch64 | 52 +++++++++++++------------- Dockerfile.armhf | 52 +++++++++++++------------- Jenkinsfile | 2 +- README.md | 17 ++++++--- jenkins-vars.yml | 2 +- readme-vars.yml | 16 ++++++-- root/etc/cont-init.d/30-config | 2 +- root/etc/services.d/radarr/run | 8 ++-- 10 files changed, 109 insertions(+), 96 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 9aaf867..d822145 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -18,7 +18,7 @@ jobs: fi echo "**** External trigger running off of nightly branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_RADARR_NIGHTLY\". ****" echo "**** Retrieving external version ****" - EXT_RELEASE=$(curl -sL https://radarr.servarr.com/v1/update/nightly/changes?os=linux | jq -r '.[0].version') + EXT_RELEASE=$(curl -sL https://radarr.servarr.com/v1/update/nightly/changes?runtime=netcore%26os=linux | jq -r '.[0].version') if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" FAILURE_REASON="Can't retrieve external version for radarr branch nightly" diff --git a/Dockerfile b/Dockerfile index ca2a169..031038e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,32 +13,32 @@ ARG RADARR_BRANCH="nightly" ENV XDG_CONFIG_HOME="/config/xdg" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install --no-install-recommends -y \ - jq \ - libicu66 \ - libmediainfo0v5 \ - sqlite3 && \ - echo "**** install radarr ****" && \ - mkdir -p /app/radarr/bin && \ - if [ -z ${RADARR_RELEASE+x} ]; then \ - RADARR_RELEASE=$(curl -sL "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/changes?os=linux" \ - | jq -r '.[0].version'); \ - fi && \ - curl -o \ - /tmp/radarr.tar.gz -L \ - "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/updatefile?version=${RADARR_RELEASE}&os=linux&runtime=netcore&arch=x64" && \ - tar ixzf \ - /tmp/radarr.tar.gz -C \ - /app/radarr/bin --strip-components=1 && \ - echo "UpdateMethod=docker\nBranch=${RADARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/radarr/package_info && \ - echo "**** cleanup ****" && \ - rm -rf \ - /app/radarr/bin/Radarr.Update \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + jq \ + libicu66 \ + libmediainfo0v5 \ + sqlite3 && \ + echo "**** install radarr ****" && \ + mkdir -p /app/radarr/bin && \ + if [ -z ${RADARR_RELEASE+x} ]; then \ + RADARR_RELEASE=$(curl -sL "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/changes?runtime=netcore&os=linux" \ + | jq -r '.[0].version'); \ + fi && \ + curl -o \ + /tmp/radarr.tar.gz -L \ + "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/updatefile?version=${RADARR_RELEASE}&os=linux&runtime=netcore&arch=x64" && \ + tar ixzf \ + /tmp/radarr.tar.gz -C \ + /app/radarr/bin --strip-components=1 && \ + echo "UpdateMethod=docker\nBranch=${RADARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/radarr/package_info && \ + echo "**** cleanup ****" && \ + rm -rf \ + /app/radarr/bin/Radarr.Update \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # copy local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 8a8ba11..2ec7e43 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -13,32 +13,32 @@ ARG RADARR_BRANCH="nightly" ENV XDG_CONFIG_HOME="/config/xdg" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install --no-install-recommends -y \ - jq \ - libicu66 \ - libmediainfo0v5 \ - sqlite3 && \ - echo "**** install radarr ****" && \ - mkdir -p /app/radarr/bin && \ - if [ -z ${RADARR_RELEASE+x} ]; then \ - RADARR_RELEASE=$(curl -sL "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/changes?os=linux" \ - | jq -r '.[0].version'); \ - fi && \ - curl -o \ - /tmp/radarr.tar.gz -L \ - "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/updatefile?version=${RADARR_RELEASE}&os=linux&runtime=netcore&arch=arm64" && \ - tar ixzf \ - /tmp/radarr.tar.gz -C \ - /app/radarr/bin --strip-components=1 && \ - echo "UpdateMethod=docker\nBranch=${RADARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/radarr/package_info && \ - echo "**** cleanup ****" && \ - rm -rf \ - /app/radarr/bin/Radarr.Update \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + jq \ + libicu66 \ + libmediainfo0v5 \ + sqlite3 && \ + echo "**** install radarr ****" && \ + mkdir -p /app/radarr/bin && \ + if [ -z ${RADARR_RELEASE+x} ]; then \ + RADARR_RELEASE=$(curl -sL "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/changes?runtime=netcore&os=linux" \ + | jq -r '.[0].version'); \ + fi && \ + curl -o \ + /tmp/radarr.tar.gz -L \ + "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/updatefile?version=${RADARR_RELEASE}&os=linux&runtime=netcore&arch=arm64" && \ + tar ixzf \ + /tmp/radarr.tar.gz -C \ + /app/radarr/bin --strip-components=1 && \ + echo "UpdateMethod=docker\nBranch=${RADARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/radarr/package_info && \ + echo "**** cleanup ****" && \ + rm -rf \ + /app/radarr/bin/Radarr.Update \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # copy local files COPY root/ / diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 2763b0b..1c3c20d 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -13,32 +13,32 @@ ARG RADARR_BRANCH="nightly" ENV XDG_CONFIG_HOME="/config/xdg" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install --no-install-recommends -y \ - jq \ - libicu66 \ - libmediainfo0v5 \ - sqlite3 && \ - echo "**** install radarr ****" && \ - mkdir -p /app/radarr/bin && \ - if [ -z ${RADARR_RELEASE+x} ]; then \ - RADARR_RELEASE=$(curl -sL "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/changes?os=linux" \ - | jq -r '.[0].version'); \ - fi && \ - curl -o \ - /tmp/radarr.tar.gz -L \ - "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/updatefile?version=${RADARR_RELEASE}&os=linux&runtime=netcore&arch=arm" && \ - tar ixzf \ - /tmp/radarr.tar.gz -C \ - /app/radarr/bin --strip-components=1 && \ - echo "**** cleanup ****" && \ - echo "UpdateMethod=docker\nBranch=${RADARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/radarr/package_info && \ - rm -rf \ - /app/radarr/bin/Radarr.Update \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + jq \ + libicu66 \ + libmediainfo0v5 \ + sqlite3 && \ + echo "**** install radarr ****" && \ + mkdir -p /app/radarr/bin && \ + if [ -z ${RADARR_RELEASE+x} ]; then \ + RADARR_RELEASE=$(curl -sL "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/changes?runtime=netcore&os=linux" \ + | jq -r '.[0].version'); \ + fi && \ + curl -o \ + /tmp/radarr.tar.gz -L \ + "https://radarr.servarr.com/v1/update/${RADARR_BRANCH}/updatefile?version=${RADARR_RELEASE}&os=linux&runtime=netcore&arch=arm" && \ + tar ixzf \ + /tmp/radarr.tar.gz -C \ + /app/radarr/bin --strip-components=1 && \ + echo "**** cleanup ****" && \ + echo "UpdateMethod=docker\nBranch=${RADARR_BRANCH}\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/radarr/package_info && \ + rm -rf \ + /app/radarr/bin/Radarr.Update \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # copy local files COPY root/ / diff --git a/Jenkinsfile b/Jenkinsfile index 64ea065..8e52794 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { steps{ script{ env.EXT_RELEASE = sh( - script: ''' curl -sL https://radarr.servarr.com/v1/update/nightly/changes?os=linux | jq -r '.[0].version' ''', + script: ''' curl -sL https://radarr.servarr.com/v1/update/nightly/changes?runtime=netcore%26os=linux | jq -r '.[0].version' ''', returnStdout: true).trim() env.RELEASE_LINK = 'custom_command' } diff --git a/README.md b/README.md index 5f4efa0..3dae77c 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,13 @@ This image provides various versions that are available via tags. `latest` tag u Access the webui at `:7878`, for more information check out [Radarr](https://github.com/Radarr/Radarr). -**Special Note**: Following our current folder structure will result in an inability to hardlink from your downloads to your movies folder because they are on seperate volumes. To support hardlinking, ensure that the movies and downloads data are on a single volume. For example, if you have `/mnt/storage/Movies` and `/mnt/storage/downloads/completed/Movies`, you would want something like `/mnt/storage:/media` for your volume. Then you can hardlink from `/media/downloads/completed` to `/media/Movies`. +### Media folders -Another item to keep in mind, is that within Radarr itself, you should map your download client folder to your radarr folder. Navigate to **Settings -> Download Client -> Advanced Settings -> Remote Path Mappings**. Add a new mapping, and set: the Host as the same entry of the Host in your download client (for example its IP address), the Remote Path as `/downloads/Movies` (relative to the internal container path), and Local Path as `/media/downloads/completed/Movies`, assuming you have folders to separate your downloaded data types. +We have set `/movies` 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 @@ -93,8 +97,8 @@ services: - TZ=Europe/London volumes: - /path/to/data:/config - - /path/to/movies:/movies - - /path/to/downloadclient-downloads:/downloads + - /path/to/movies:/movies #optional + - /path/to/downloadclient-downloads:/downloads #optional ports: - 7878:7878 restart: unless-stopped @@ -110,8 +114,8 @@ docker run -d \ -e TZ=Europe/London \ -p 7878:7878 \ -v /path/to/data:/config \ - -v /path/to/movies:/movies \ - -v /path/to/downloadclient-downloads:/downloads \ + -v /path/to/movies:/movies `#optional` \ + -v /path/to/downloadclient-downloads:/downloads `#optional` \ --restart unless-stopped \ ghcr.io/linuxserver/radarr ``` @@ -239,6 +243,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **11.07.21:** - Make the paths clearer to the user * **17.01.21:** - Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information. * **09.27.20:** - Merge Preview into Nightly. * **05.04.20:** - Move app to /app. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 0f787cb..8bf5862 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -3,7 +3,7 @@ # jenkins variables project_name: docker-radarr external_type: na -custom_version_command: curl -sL https://radarr.servarr.com/v1/update/nightly/changes?os=linux | jq -r '.[0].version' +custom_version_command: curl -sL https://radarr.servarr.com/v1/update/nightly/changes?runtime=netcore%26os=linux | jq -r '.[0].version' release_type: prerelease release_tag: nightly ls_branch: nightly diff --git a/readme-vars.yml b/readme-vars.yml index 89d43f1..b116699 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -26,6 +26,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 Radarr configs" } + +opt_param_usage_include_vols: true +opt_param_volumes: - { vol_path: "/movies", vol_host_path: "/path/to/movies", desc: "Location of Movie 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)" } @@ -42,13 +45,18 @@ opt_param_usage_include_env: false app_setup_block_enabled: true app_setup_block: | Access the webui at `:7878`, for more information check out [Radarr](https://github.com/Radarr/Radarr). - - **Special Note**: Following our current folder structure will result in an inability to hardlink from your downloads to your movies folder because they are on seperate volumes. To support hardlinking, ensure that the movies and downloads data are on a single volume. For example, if you have `/mnt/storage/Movies` and `/mnt/storage/downloads/completed/Movies`, you would want something like `/mnt/storage:/media` for your volume. Then you can hardlink from `/media/downloads/completed` to `/media/Movies`. - - Another item to keep in mind, is that within Radarr itself, you should map your download client folder to your radarr folder. Navigate to **Settings -> Download Client -> Advanced Settings -> Remote Path Mappings**. Add a new mapping, and set: the Host as the same entry of the Host in your download client (for example its IP address), the Remote Path as `/downloads/Movies` (relative to the internal container path), and Local Path as `/media/downloads/completed/Movies`, assuming you have folders to separate your downloaded data types. + + ### Media folders + + We have set `/movies` 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. # changelog changelogs: + - { date: "11.07.21:", desc: "Make the paths clearer to the user" } - { date: "17.01.21:", desc: "Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information." } - { date: "09.27.20:", desc: "Merge Preview into Nightly." } - { 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 cb95d64..aa3208d 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -2,4 +2,4 @@ # permissions chown -R abc:abc \ - /config + /config diff --git a/root/etc/services.d/radarr/run b/root/etc/services.d/radarr/run index cc8a724..9a42a4e 100644 --- a/root/etc/services.d/radarr/run +++ b/root/etc/services.d/radarr/run @@ -1,10 +1,10 @@ #!/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 exec \ - s6-setuidgid abc /app/radarr/bin/Radarr \ - -nobrowser -data=/config + s6-setuidgid abc /app/radarr/bin/Radarr \ + -nobrowser -data=/config