diff --git a/Dockerfile b/Dockerfile index b1201cc..9b70f2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,84 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 as build-stage - -ARG BUILD_DATE -ARG VERSION -ARG QBITTORRENT_VERSION - -ENV HOME="/config" \ -XDG_CONFIG_HOME="/config" \ -XDG_DATA_HOME="/config" - -RUN \ - echo "**** install packages ****" && \ - apk add -U --update --no-cache --virtual=build-dependencies \ - autoconf \ - automake \ - boost-dev \ - build-base \ - cmake \ - curl \ - git \ - grep \ - jq \ - libtool \ - linux-headers \ - perl \ - pkgconf \ - python3-dev \ - re2c \ - icu-dev \ - libexecinfo-dev \ - openssl-dev \ - qt6-qtbase-dev \ - qt6-qttools-dev \ - qt6-qtsvg-dev \ - zlib-dev && \ - mkdir -p /build && \ - echo "**** build ninja ****" && \ - git clone --shallow-submodules --recurse-submodules https://github.com/ninja-build/ninja.git ~/ninja && cd ~/ninja && \ - git checkout "$(git tag -l --sort=-v:refname "v*" | head -n 1)" && \ - cmake -Wno-dev -B build \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_INSTALL_PREFIX="/usr" && \ - cmake --build build && \ - cmake --install build && \ - echo "**** build libtorrent ****" && \ - git clone --shallow-submodules --recurse-submodules https://github.com/arvidn/libtorrent.git ~/libtorrent && cd ~/libtorrent && \ - git checkout "$(git tag -l --sort=-v:refname "v2*" | head -n 1)" && \ - cmake -Wno-dev -G Ninja -B build \ - -D CMAKE_BUILD_TYPE="release" \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_INSTALL_LIBDIR="lib" \ - -D CMAKE_INSTALL_PREFIX="/usr" && \ - cmake --build build && \ - cmake --install build && \ - echo "**** build qbittorrent ****" && \ - if [ -z ${QBITTORRENT_VERSION+x} ]; then \ - QBITTORRENT_VERSION=$(curl -sX GET "https://api.github.com/repos/qbittorrent/qBittorrent/tags" | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$'); \ - fi && \ - git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git ~/qbittorrent && cd ~/qbittorrent && \ - git checkout "$(git tag -l --sort=-v:refname "${QBITTORRENT_VERSION}" | head -n 1)" && \ - cmake -Wno-dev -G Ninja -B build \ - -D CMAKE_BUILD_TYPE="release" \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_CXX_STANDARD_LIBRARIES="/usr/lib/libexecinfo.so" \ - -D CMAKE_INSTALL_PREFIX="/build/usr" \ - -D GUI=OFF \ - -D QT6=ON && \ - cmake --build build && \ - cmake --install build && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /config/* \ - /tmp/* - -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 +FROM ghcr.io/linuxserver/baseimage-alpine:edge # set version label ARG BUILD_DATE ARG VERSION +ARG QBITTORRENT_VERSION ARG QBT_VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="thespad" @@ -88,25 +13,17 @@ ENV HOME="/config" \ XDG_CONFIG_HOME="/config" \ XDG_DATA_HOME="/config" -#copy build artifacts from build-stage -COPY --from=build-stage /build/usr/ /usr/ -COPY --from=build-stage /usr/lib/libtorrent-rasterbar.so.* /usr/lib/ - # install runtime packages and qbitorrent-cli RUN \ apk add -U --update --no-cache \ - p7zip \ - geoip \ - unzip \ bash \ - curl \ - icu-libs\ - libexecinfo \ - openssl \ - python3 \ - qt6-qtbase \ - zlib && \ - apk add -U --upgrade --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main/ unrar && \ + curl && \ + if [ -z ${QBITTORRENT_VERSION+x} ]; then \ + QBITTORRENT_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \ + && awk '/^P:qbittorrent-nox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \ + fi && \ + apk add -U --upgrade --no-cache \ + qbittorrent-nox==${QBITTORRENT_VERSION} && \ echo "***** install qbitorrent-cli ****" && \ if [ -z ${QBT_VERSION+x} ]; then \ QBT_VERSION=$(curl -sX GET "https://api.github.com/repos/ludviglundgren/qbittorrent-cli/releases/latest" \ @@ -121,12 +38,12 @@ RUN \ mv /tmp/qbt /usr/bin && \ echo "**** cleanup ****" && \ rm -rf \ - /tmp/* \ - /var/tmp/* + /tmp/* # add local files COPY root/ / # ports and volumes -EXPOSE 6881 6881/udp 8080 +EXPOSE 8080 6881 6881/udp + VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 5e028dd..a20e2bb 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,84 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15 as build-stage - -ARG BUILD_DATE -ARG VERSION -ARG QBITTORRENT_VERSION - -ENV HOME="/config" \ -XDG_CONFIG_HOME="/config" \ -XDG_DATA_HOME="/config" - -RUN \ - echo "**** install packages ****" && \ - apk add -U --update --no-cache --virtual=build-dependencies \ - autoconf \ - automake \ - boost-dev \ - build-base \ - cmake \ - curl \ - git \ - grep \ - jq \ - libtool \ - linux-headers \ - perl \ - pkgconf \ - python3-dev \ - re2c \ - icu-dev \ - libexecinfo-dev \ - openssl-dev \ - qt6-qtbase-dev \ - qt6-qttools-dev \ - qt6-qtsvg-dev \ - zlib-dev && \ - mkdir -p /build && \ - echo "**** build ninja ****" && \ - git clone --shallow-submodules --recurse-submodules https://github.com/ninja-build/ninja.git ~/ninja && cd ~/ninja && \ - git checkout "$(git tag -l --sort=-v:refname "v*" | head -n 1)" && \ - cmake -Wno-dev -B build \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_INSTALL_PREFIX="/usr" && \ - cmake --build build && \ - cmake --install build && \ - echo "**** build libtorrent ****" && \ - git clone --shallow-submodules --recurse-submodules https://github.com/arvidn/libtorrent.git ~/libtorrent && cd ~/libtorrent && \ - git checkout "$(git tag -l --sort=-v:refname "v2*" | head -n 1)" && \ - cmake -Wno-dev -G Ninja -B build \ - -D CMAKE_BUILD_TYPE="release" \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_INSTALL_LIBDIR="lib" \ - -D CMAKE_INSTALL_PREFIX="/usr" && \ - cmake --build build && \ - cmake --install build && \ - echo "**** build qbittorrent ****" && \ - if [ -z ${QBITTORRENT_VERSION+x} ]; then \ - QBITTORRENT_VERSION=$(curl -sX GET "https://api.github.com/repos/qbittorrent/qBittorrent/tags" | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$'); \ - fi && \ - git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git ~/qbittorrent && cd ~/qbittorrent && \ - git checkout "$(git tag -l --sort=-v:refname "${QBITTORRENT_VERSION}" | head -n 1)" && \ - cmake -Wno-dev -G Ninja -B build \ - -D CMAKE_BUILD_TYPE="release" \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_CXX_STANDARD_LIBRARIES="/usr/lib/libexecinfo.so" \ - -D CMAKE_INSTALL_PREFIX="/build/usr" \ - -D GUI=OFF \ - -D QT6=ON && \ - cmake --build build && \ - cmake --install build && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /config/* \ - /tmp/* - -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-edge # set version label ARG BUILD_DATE ARG VERSION +ARG QBITTORRENT_VERSION ARG QBT_VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="thespad" @@ -88,25 +13,17 @@ ENV HOME="/config" \ XDG_CONFIG_HOME="/config" \ XDG_DATA_HOME="/config" -#copy build artifacts from build-stage -COPY --from=build-stage /build/usr/ /usr/ -COPY --from=build-stage /usr/lib/libtorrent-rasterbar.so.* /usr/lib/ - # install runtime packages and qbitorrent-cli RUN \ apk add -U --update --no-cache \ - p7zip \ - geoip \ - unzip \ bash \ - curl \ - icu-libs \ - libexecinfo \ - openssl \ - python3 \ - qt6-qtbase \ - zlib && \ - apk add -U --upgrade --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main/ unrar && \ + curl && \ + if [ -z ${QBITTORRENT_VERSION+x} ]; then \ + QBITTORRENT_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp \ + && awk '/^P:qbittorrent-nox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \ + fi && \ + apk add -U --upgrade --no-cache \ + qbittorrent-nox==${QBITTORRENT_VERSION} && \ echo "***** install qbitorrent-cli ****" && \ if [ -z ${QBT_VERSION+x} ]; then \ QBT_VERSION=$(curl -sX GET "https://api.github.com/repos/ludviglundgren/qbittorrent-cli/releases/latest" \ @@ -114,19 +31,19 @@ RUN \ fi && \ curl -o \ /tmp/qbt.tar.gz -L \ - "https://github.com/ludviglundgren/qbittorrent-cli/releases/download/${QBT_VERSION}/qbittorrent-cli_$(echo $QBT_VERSION | cut -c2-)_linux_amd64.tar.gz" && \ + "https://github.com/ludviglundgren/qbittorrent-cli/releases/download/${QBT_VERSION}/qbittorrent-cli_$(echo $QBT_VERSION | cut -c2-)_linux_arm64.tar.gz" && \ tar xzf \ /tmp/qbt.tar.gz -C \ /tmp && \ mv /tmp/qbt /usr/bin && \ echo "**** cleanup ****" && \ rm -rf \ - /tmp/* \ - /var/tmp/* + /tmp/* # add local files COPY root/ / # ports and volumes -EXPOSE 6881 6881/udp 8080 +EXPOSE 8080 6881 6881/udp + VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 10fcc03..4419b28 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,84 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15 as build-stage - -ARG BUILD_DATE -ARG VERSION -ARG QBITTORRENT_VERSION - -ENV HOME="/config" \ -XDG_CONFIG_HOME="/config" \ -XDG_DATA_HOME="/config" - -RUN \ - echo "**** install packages ****" && \ - apk add -U --update --no-cache --virtual=build-dependencies \ - autoconf \ - automake \ - boost-dev \ - build-base \ - cmake \ - curl \ - git \ - grep \ - jq \ - libtool \ - linux-headers \ - perl \ - pkgconf \ - python3-dev \ - re2c \ - icu-dev \ - libexecinfo-dev \ - openssl-dev \ - qt6-qtbase-dev \ - qt6-qttools-dev \ - qt6-qtsvg-dev \ - zlib-dev && \ - mkdir -p /build && \ - echo "**** build ninja ****" && \ - git clone --shallow-submodules --recurse-submodules https://github.com/ninja-build/ninja.git ~/ninja && cd ~/ninja && \ - git checkout "$(git tag -l --sort=-v:refname "v*" | head -n 1)" && \ - cmake -Wno-dev -B build \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_INSTALL_PREFIX="/usr" && \ - cmake --build build && \ - cmake --install build && \ - echo "**** build libtorrent ****" && \ - git clone --shallow-submodules --recurse-submodules https://github.com/arvidn/libtorrent.git ~/libtorrent && cd ~/libtorrent && \ - git checkout "$(git tag -l --sort=-v:refname "v2*" | head -n 1)" && \ - cmake -Wno-dev -G Ninja -B build \ - -D CMAKE_BUILD_TYPE="release" \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_INSTALL_LIBDIR="lib" \ - -D CMAKE_INSTALL_PREFIX="/usr" && \ - cmake --build build && \ - cmake --install build && \ - echo "**** build qbittorrent ****" && \ - if [ -z ${QBITTORRENT_VERSION+x} ]; then \ - QBITTORRENT_VERSION=$(curl -sX GET "https://api.github.com/repos/qbittorrent/qBittorrent/tags" | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$'); \ - fi && \ - git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git ~/qbittorrent && cd ~/qbittorrent && \ - git checkout "$(git tag -l --sort=-v:refname "${QBITTORRENT_VERSION}" | head -n 1)" && \ - cmake -Wno-dev -G Ninja -B build \ - -D CMAKE_BUILD_TYPE="release" \ - -D CMAKE_CXX_STANDARD=17 \ - -D CMAKE_CXX_STANDARD_LIBRARIES="/usr/lib/libexecinfo.so" \ - -D CMAKE_INSTALL_PREFIX="/build/usr" \ - -D GUI=OFF \ - -D QT6=ON && \ - cmake --build build && \ - cmake --install build && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /config/* \ - /tmp/* - -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-edge # set version label ARG BUILD_DATE ARG VERSION +ARG QBITTORRENT_VERSION ARG QBT_VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="thespad" @@ -88,25 +13,17 @@ ENV HOME="/config" \ XDG_CONFIG_HOME="/config" \ XDG_DATA_HOME="/config" -#copy build artifacts from build-stage -COPY --from=build-stage /build/usr/ /usr/ -COPY --from=build-stage /usr/lib/libtorrent-rasterbar.so.* /usr/lib/ - # install runtime packages and qbitorrent-cli RUN \ apk add -U --update --no-cache \ - p7zip \ - geoip \ - unzip \ bash \ - curl \ - icu-libs \ - libexecinfo \ - openssl \ - python3 \ - qt6-qtbase \ - zlib && \ - apk add -U --upgrade --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main/ unrar && \ + curl && \ + if [ -z ${QBITTORRENT_VERSION+x} ]; then \ + QBITTORRENT_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/armhf/APKINDEX.tar.gz" | tar -xz -C /tmp \ + && awk '/^P:qbittorrent-nox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \ + fi && \ + apk add -U --upgrade --no-cache \ + qbittorrent-nox==${QBITTORRENT_VERSION} && \ echo "***** install qbitorrent-cli ****" && \ if [ -z ${QBT_VERSION+x} ]; then \ QBT_VERSION=$(curl -sX GET "https://api.github.com/repos/ludviglundgren/qbittorrent-cli/releases/latest" \ @@ -114,19 +31,19 @@ RUN \ fi && \ curl -o \ /tmp/qbt.tar.gz -L \ - "https://github.com/ludviglundgren/qbittorrent-cli/releases/download/${QBT_VERSION}/qbittorrent-cli_$(echo $QBT_VERSION | cut -c2-)_linux_amd64.tar.gz" && \ + "https://github.com/ludviglundgren/qbittorrent-cli/releases/download/${QBT_VERSION}/qbittorrent-cli_$(echo $QBT_VERSION | cut -c2-)_linux_armv6.tar.gz" && \ tar xzf \ /tmp/qbt.tar.gz -C \ /tmp && \ mv /tmp/qbt /usr/bin && \ echo "**** cleanup ****" && \ rm -rf \ - /tmp/* \ - /var/tmp/* + /tmp/* # add local files COPY root/ / # ports and volumes -EXPOSE 6881 6881/udp 8080 +EXPOSE 8080 6881 6881/udp + VOLUME /config diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 291f8dd..8f66a0e 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,8 +2,7 @@ # jenkins variables project_name: docker-qbittorrent -external_type: na -custom_version_command: "curl -sX GET 'https://api.github.com/repos/qbittorrent/qBittorrent/tags' | jq -r '.[].name' | grep -Po -m 1 '^release-(\\\\d+(\\\\.)?)+$'" +external_type: alpine_repo release_type: stable release_tag: latest ls_branch: master @@ -16,6 +15,9 @@ repo_vars: - DEV_DOCKERHUB_IMAGE = 'lsiodev/qbittorrent' - PR_DOCKERHUB_IMAGE = 'lspipepr/qbittorrent' - DIST_IMAGE = 'alpine' + - DIST_TAG = 'edge' + - DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/' + - DIST_REPO_PACKAGES = 'qbittorrent-nox' - MULTIARCH='true' - CI='true' - CI_WEB='true' diff --git a/readme-vars.yml b/readme-vars.yml index 466e0dd..156a1a7 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -69,6 +69,7 @@ app_setup_block: | # changelog changelogs: + - { date: "23.02.22:", desc: "Rebase to Alpine Edge, install from Alpine repos." } - { date: "19.02.22:", desc: "Add jq to build-stage" } - { date: "07.01.22:", desc: "Rebase to Alpine, build from source." } - { date: "06.01.22:", desc: "Deprecate unstable branch." } diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index b4f96e2..40f6d81 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -7,13 +7,6 @@ mkdir -p /config/qBittorrent [[ ! -e /config/qBittorrent/qBittorrent.conf ]] && \ cp /defaults/qBittorrent.conf /config/qBittorrent/qBittorrent.conf -# v4.3.3 BT_backup migration -[[ -d /config/data/qBittorrent/BT_backup/ ]] && \ - mv /config/qBittorrent/BT_backup/ /config/qBittorrent/BT_backup.bak/ && \ - mkdir /config/qBittorrent/BT_backup/ && \ - cp -a /config/data/qBittorrent/BT_backup/. /config/qBittorrent/BT_backup/ && \ - mv /config/data/qBittorrent/BT_backup/ /config/data/qBittorrent/BT_backup.old/ - # chown download directory if currently not set to abc if [[ -d /downloads ]]; then if [[ "$(stat -c '%U' /downloads)" != "abc" ]]; then