From acb875e4400250bc41c49fccbd78ad6866023d05 Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 2 Apr 2026 15:02:54 +0000 Subject: [PATCH 1/4] Install from pypi to work around Alpine edge package deprecations? --- Dockerfile | 36 +++++++++++++++++++++++++----------- Dockerfile.aarch64 | 35 ++++++++++++++++++++++++----------- README.md | 1 + readme-vars.yml | 1 + 4 files changed, 51 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 032d3e3..501f854 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,9 @@ FROM ghcr.io/linuxserver/unrar:latest AS unrar -FROM ghcr.io/linuxserver/baseimage-alpine:edge +FROM ghcr.io/by275/libtorrent:2-alpine3.23 AS libtorrent + +FROM ghcr.io/linuxserver/baseimage-alpine:3.23 # set version label ARG BUILD_DATE @@ -19,19 +21,27 @@ ENV PYTHON_EGG_CACHE="/config/plugins/.python-eggs" \ RUN \ echo "**** install build packages ****" && \ apk add --no-cache --upgrade --virtual=build-dependencies \ - build-base && \ + build-base \ + python3-dev && \ echo "**** install packages ****" && \ - if [ -z ${DELUGE_VERSION+x} ]; then \ - DELUGE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \ - && awk '/^P:deluge$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \ - fi && \ - apk add --no-cache --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ - deluge==${DELUGE_VERSION} \ + apk add --no-cache --upgrade \ + boost1.84-python3 \ + geoip \ python3 \ - py3-future \ - py3-geoip \ - py3-requests \ p7zip && \ + if [ -z ${DELUGE_VERSION+x} ]; then \ + DELUGE_VERSION=$(curl -sL https://pypi.python.org/pypi/deluge/json |jq -r '. | .info.version');\ + fi && \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir \ + pip \ + setuptools \ + wheel && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \ + rencode==1.0.6 && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \ + deluge[all]==${DELUGE_VERSION} \ + pygeoip && \ echo "**** grab GeoIP database ****" && \ curl -L --retry 10 --retry-max-time 60 --retry-all-errors \ "https://geoip.linuxserver.io/GeoIP.dat.gz" \ @@ -44,6 +54,10 @@ RUN \ $HOME/.cache \ /tmp/* + COPY --from=libtorrent /libtorrent-build/usr/lib/libtorrent-rasterbar.* /usr/lib/ + + COPY --from=libtorrent /libtorrent-build/usr/lib/python3.12 /lsiopy/lib/python3.12 + # add local files COPY root/ / diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 2d364df..5713f13 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -2,7 +2,9 @@ FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-edge +FROM ghcr.io/by275/libtorrent:2-alpine3.23-arm64 AS libtorrent + +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.23 # set version label ARG BUILD_DATE @@ -19,19 +21,26 @@ ENV PYTHON_EGG_CACHE="/config/plugins/.python-eggs" \ RUN \ echo "**** install build packages ****" && \ apk add --no-cache --upgrade --virtual=build-dependencies \ - build-base && \ + build-base \ + python3-dev && \ echo "**** install packages ****" && \ - if [ -z ${DELUGE_VERSION+x} ]; then \ - DELUGE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \ - && awk '/^P:deluge$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \ - fi && \ - apk add --no-cache --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ - deluge==${DELUGE_VERSION} \ + apk add --no-cache --upgrade \ + boost1.84-python3 \ + geoip \ python3 \ - py3-future \ - py3-geoip \ - py3-requests \ p7zip && \ + if [ -z ${DELUGE_VERSION+x} ]; then \ + DELUGE_VERSION=$(curl -sL https://pypi.python.org/pypi/deluge/json |jq -r '. | .info.version');\ + fi && \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir \ + pip \ + 'setuptools==81' && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \ + rencode==1.0.6 && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \ + deluge[all]==${DELUGE_VERSION} \ + pygeoip && \ echo "**** grab GeoIP database ****" && \ curl -L --retry 10 --retry-max-time 60 --retry-all-errors \ "https://geoip.linuxserver.io/GeoIP.dat.gz" \ @@ -44,6 +53,10 @@ RUN \ $HOME/.cache \ /tmp/* + COPY --from=libtorrent /libtorrent-build/usr/lib/libtorrent-rasterbar.* /usr/lib/ + + COPY --from=libtorrent /libtorrent-build/usr/lib/python3.12 /lsiopy/lib/python3.12 + # add local files COPY root/ / diff --git a/README.md b/README.md index cb4c6eb..3efcb9f 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **02.04.26:** - Install from pypi due to Alpine geoip package deprecation. * **29.12.25:** - Fix some issues with GeoIP updates. * **23.08.25:** - Update GeoIP provider, add weekly cronjob to update. * **12.01.25:** - Rebase libtorrentv1 branch to Alpine 3.21. diff --git a/readme-vars.yml b/readme-vars.yml index 8bdead4..8c643be 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -101,6 +101,7 @@ init_diagram: | "deluge:latest" <- Base Images # changelog changelogs: + - {date: "02.04.26:", desc: "Install from pypi due to Alpine geoip package deprecation."} - {date: "29.12.25:", desc: "Fix some issues with GeoIP updates."} - {date: "23.08.25:", desc: "Update GeoIP provider, add weekly cronjob to update."} - {date: "12.01.25:", desc: "Rebase libtorrentv1 branch to Alpine 3.21."} From 52dac499179aeb340e44ec4c68e856d57c6db01d Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 2 Apr 2026 15:44:54 +0000 Subject: [PATCH 2/4] Update release check type --- .github/workflows/external_trigger.yml | 12 ++---------- Jenkinsfile | 18 +++++++----------- jenkins-vars.yml | 6 ++---- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 8a4daa8..d4facbe 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -29,9 +29,8 @@ jobs: echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY echo "> External trigger running off of master branch. To disable this trigger, add \`deluge_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY - EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \ - && awk '/^P:'"deluge"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') - echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY + EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/deluge/json" |jq -r '. | .info.version') + echo "Type is \`pip_version\`" >> $GITHUB_STEP_SUMMARY if grep -q "^deluge_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY @@ -107,13 +106,6 @@ jobs: if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY exit 0 - elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"deluge"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then - echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY - FAILURE_REASON="New version ${EXT_RELEASE} for deluge tag latest is detected, however not all arch repos are updated yet. Will try again later." - curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, - "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], - "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} - exit 0 elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-deluge/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY exit 0 diff --git a/Jenkinsfile b/Jenkinsfile index 98bc365..2102157 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,7 @@ pipeline { QUAYIO_API_TOKEN=credentials('quayio-repo-api-token') GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f') BUILD_VERSION_ARG = 'DELUGE_VERSION' + EXT_PIP='deluge' LS_USER = 'linuxserver' LS_REPO = 'docker-deluge' CONTAINER_NAME = 'deluge' @@ -27,9 +28,6 @@ pipeline { DEV_DOCKERHUB_IMAGE = 'lsiodev/deluge' PR_DOCKERHUB_IMAGE = 'lspipepr/deluge' DIST_IMAGE = 'alpine' - DIST_TAG = 'edge' - DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/' - DIST_REPO_PACKAGES = 'deluge' MULTIARCH='true' CI='true' CI_WEB='true' @@ -145,19 +143,17 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is an alpine repo change for external version determine an md5 from the version string - stage("Set tag Alpine Repo"){ + // If this is a pip release set the external tag to the pip version + stage("Set ENV pip_version"){ steps{ script{ env.EXT_RELEASE = sh( - script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \ - && awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''', + script: '''curl -sL https://pypi.python.org/pypi/${EXT_PIP}/json |jq -r '. | .info.version' ''', returnStdout: true).trim() - env.RELEASE_LINK = 'alpine_repo' + env.RELEASE_LINK = 'https://pypi.python.org/pypi/' + env.EXT_PIP } } - } - // Sanitize the release tag and strip illegal docker or github characters + } // Sanitize the release tag and strip illegal docker or github characters stage("Sanitize tag"){ steps{ script{ @@ -1024,7 +1020,7 @@ pipeline { "type": "commit",\ "tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' echo "Pushing New release for Tag" - echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json + echo "Updating PIP version of ${EXT_PIP} to ${EXT_RELEASE_CLEAN}" > releasebody.json jq -n \ --arg tag_name "$META_TAG" \ --arg target_commitish "master" \ diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 6154edf..ebfd361 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,12 +2,13 @@ # jenkins variables project_name: docker-deluge -external_type: alpine_repo +external_type: pip_version release_type: stable release_tag: latest ls_branch: master repo_vars: - BUILD_VERSION_ARG = 'DELUGE_VERSION' + - EXT_PIP='deluge' - LS_USER = 'linuxserver' - LS_REPO = 'docker-deluge' - CONTAINER_NAME = 'deluge' @@ -15,9 +16,6 @@ repo_vars: - DEV_DOCKERHUB_IMAGE = 'lsiodev/deluge' - PR_DOCKERHUB_IMAGE = 'lspipepr/deluge' - DIST_IMAGE = 'alpine' - - DIST_TAG = 'edge' - - DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/' - - DIST_REPO_PACKAGES = 'deluge' - MULTIARCH='true' - CI='true' - CI_WEB='true' From 5284fc5f4ea2b5b6239b39f863c04b77f21b99d2 Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 2 Apr 2026 15:51:50 +0000 Subject: [PATCH 3/4] Pin setuptools in both dockerfiles --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 501f854..9dc36b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,8 +35,7 @@ RUN \ python3 -m venv /lsiopy && \ pip install -U --no-cache-dir \ pip \ - setuptools \ - wheel && \ + 'setuptools==81' && \ pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \ rencode==1.0.6 && \ pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \ From fbb76a7d7fbd8be361c6c7a0ee3433d073ada544 Mon Sep 17 00:00:00 2001 From: thespad Date: Thu, 2 Apr 2026 18:50:35 +0000 Subject: [PATCH 4/4] Fix binary paths --- root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run | 4 ++-- root/etc/s6-overlay/s6-rc.d/svc-deluged/run | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run b/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run index 4a0b444..1209de1 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run @@ -10,9 +10,9 @@ fi if [[ -z ${LSIO_NON_ROOT_USER} ]]; then exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \ - s6-setuidgid abc /usr/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}" + s6-setuidgid abc /lsiopy/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}" else exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \ - /usr/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}" + /lsiopy/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}" fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-deluged/run b/root/etc/s6-overlay/s6-rc.d/svc-deluged/run index a8526e2..c6c20ae 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-deluged/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-deluged/run @@ -10,9 +10,9 @@ fi if [[ -z ${LSIO_NON_ROOT_USER} ]]; then exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \ - s6-setuidgid abc /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" + s6-setuidgid abc /lsiopy/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" else exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \ - /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" + /lsiopy/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" fi