Skip to content

Commit fc220bf

Browse files
committed
qBittorrent 4.4.1 and libtorrent-rasterbar 2.0.5
Multi-platform image support
1 parent 5f660cf commit fc220bf

File tree

4 files changed

+77
-46
lines changed

4 files changed

+77
-46
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
echo ::set-output name=build_tag::test
2727
echo ::set-output name=container_name::qbittorrent
2828
echo ::set-output name=running_timeout::120
29-
echo ::set-output name=running_log_check::access the Web UI at
29+
echo ::set-output name=running_log_check::access the WebUI at
3030
-
3131
name: Set up QEMU
3232
uses: docker/setup-qemu-action@v1

Dockerfile

Lines changed: 58 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,73 @@
1-
ARG LIBTORRENT_VERSION=1.2.14
2-
ARG QBITTORRENT_VERSION=4.3.8
1+
ARG QBITTORRENT_VERSION=4.4.1
2+
ARG LIBTORRENT_VERSION=2.0.5
3+
ARG XX_VERSION=1.1.0
34

4-
FROM crazymax/yasu:latest AS yasu
5-
FROM alpine:3.15 AS builder
6-
7-
RUN apk add --update --no-cache \
8-
autoconf \
9-
automake \
10-
binutils \
11-
boost-dev \
12-
build-base \
13-
cppunit-dev \
14-
git \
15-
libtool \
16-
linux-headers \
17-
ncurses-dev \
18-
openssl-dev \
19-
zlib-dev \
20-
&& rm -rf /tmp/*
5+
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
6+
FROM --platform=$BUILDPLATFORM alpine:3.15 AS base
7+
COPY --from=xx / /
8+
RUN apk --update --no-cache add git
219

10+
FROM base AS libtorrent-src
2211
ARG LIBTORRENT_VERSION
23-
RUN cd /tmp \
24-
&& git clone --branch v${LIBTORRENT_VERSION} --recurse-submodules https://github.com/arvidn/libtorrent.git \
25-
&& cd libtorrent \
26-
&& ./autotool.sh \
27-
&& ./configure CXXFLAGS="-std=c++14" --with-libiconv \
28-
&& make -j$(nproc) \
29-
&& make install-strip \
30-
&& ls -al /usr/local/lib/
31-
32-
RUN apk add --update --no-cache \
33-
qt5-qtbase \
34-
qt5-qttools-dev \
35-
&& rm -rf /tmp/*
12+
WORKDIR /src
13+
RUN git clone --branch v${LIBTORRENT_VERSION} --recurse-submodules https://github.com/arvidn/libtorrent.git .
3614

15+
FROM base AS qbittorrent-src
3716
ARG QBITTORRENT_VERSION
38-
RUN cd /tmp \
39-
&& git clone --branch release-${QBITTORRENT_VERSION} https://github.com/qbittorrent/qBittorrent.git \
40-
&& cd qBittorrent \
41-
&& ./configure --disable-gui \
42-
&& make -j$(nproc) \
43-
&& make install \
44-
&& ls -al /usr/local/bin/ \
45-
&& qbittorrent-nox --help
17+
WORKDIR /src
18+
RUN git clone --branch release-${QBITTORRENT_VERSION} --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git .
19+
20+
FROM base AS build
21+
RUN apk --update --no-cache add binutils clang cmake libtool linux-headers ninja perl pkgconf tree
4622

23+
COPY --from=libtorrent-src /src /src/libtorrent
24+
WORKDIR /src/libtorrent
25+
ARG TARGETPLATFORM
26+
RUN xx-apk --no-cache --no-scripts add gcc g++ boost-dev cppunit-dev ncurses-dev openssl-dev python3-dev py3-numpy-dev zlib-dev
27+
RUN export QEMU_LD_PREFIX=$(xx-info sysroot) \
28+
&& cmake -Wno-dev -G Ninja -B build $(xx-clang --print-cmake-defines) \
29+
-DCMAKE_SYSROOT="$(xx-info sysroot)" \
30+
-DCMAKE_CXX_FLAGS="-w -s" \
31+
-DCMAKE_BUILD_TYPE="Release" \
32+
-DCMAKE_CXX_STANDARD=17 \
33+
-DCMAKE_INSTALL_LIBDIR="lib" \
34+
-DCMAKE_INSTALL_PREFIX="$(xx-info sysroot)usr/local" \
35+
&& cmake --build build --verbose \
36+
&& cmake --install build
37+
38+
COPY --from=qbittorrent-src /src /src/qbittorrent
39+
WORKDIR /src/qbittorrent
40+
RUN xx-apk --no-cache --no-scripts add icu-dev libexecinfo-dev qt5-qtbase-dev qt5-qttools-dev qt5-qtsvg-dev
41+
RUN export QEMU_LD_PREFIX=$(xx-info sysroot) \
42+
&& cmake -Wno-dev -G Ninja -B build $(xx-clang --print-cmake-defines) \
43+
-DGUI=OFF \
44+
-DCMAKE_SYSROOT="$(xx-info sysroot)" \
45+
-DCMAKE_CXX_FLAGS="-w -s" \
46+
-DCMAKE_BUILD_TYPE="Release" \
47+
-DCMAKE_CXX_STANDARD=17 \
48+
-DCMAKE_CXX_STANDARD_LIBRARIES="$(xx-info sysroot)usr/lib/libexecinfo.so.1" \
49+
-DCMAKE_INSTALL_PREFIX="$(xx-info sysroot)usr/local" \
50+
&& cmake --build build --verbose \
51+
&& cmake --install build
52+
53+
RUN mkdir -p /out/usr/local/bin /out/usr/local/lib \
54+
&& cp $(xx-info sysroot)usr/local/lib/libtorrent-rasterbar.so* /out/usr/local/lib/ \
55+
&& cp $(xx-info sysroot)usr/local/bin/qbittorrent-nox /out/usr/local/bin/
56+
57+
FROM crazymax/yasu:latest AS yasu
4758
FROM alpine:3.15
4859

4960
COPY --from=yasu / /
50-
COPY --from=builder /usr/local/lib/libtorrent-rasterbar.so.10.0.0 /usr/lib/libtorrent-rasterbar.so.10
51-
COPY --from=builder /usr/local/bin/qbittorrent-nox /usr/bin/qbittorrent-nox
61+
COPY --from=build /out /
5262

5363
RUN apk --update --no-cache add \
5464
bind-tools \
5565
curl \
66+
icu \
67+
libexecinfo \
5668
openssl \
5769
qt5-qtbase \
70+
qt5-qtsvg \
5871
shadow \
5972
tzdata \
6073
unzip \
@@ -72,14 +85,15 @@ COPY entrypoint.sh /entrypoint.sh
7285
RUN chmod a+x /entrypoint.sh \
7386
&& addgroup -g ${PGID} qbittorrent \
7487
&& adduser -D -h ${QBITTORRENT_HOME} -u ${PUID} -G qbittorrent -s /bin/sh qbittorrent \
75-
&& qbittorrent-nox --version
88+
&& qbittorrent-nox --version \
89+
&& uname -a
7690

7791
EXPOSE 6881 6881/udp ${WEBUI_PORT}
7892
WORKDIR /data
7993
VOLUME [ "/data" ]
8094

8195
ENTRYPOINT [ "/entrypoint.sh" ]
82-
CMD [ "/usr/bin/qbittorrent-nox" ]
96+
CMD [ "/usr/local/bin/qbittorrent-nox" ]
8397

8498
HEALTHCHECK --interval=10s --timeout=10s --start-period=20s \
8599
CMD curl --fail http://127.0.0.1:${WEBUI_PORT}/api/v2/app/version || exit 1

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ___
3838
## Features
3939

4040
* Run as non-root user
41+
* Multi-platform image
4142
* Latest [qBittorrent](https://github.com/qbittorrent/qBittorrent) / [libtorrent-rasterbar](https://github.com/arvidn/libtorrent) release compiled from source
4243
* WAN IP address automatically resolved for reporting to the tracker
4344
* Finished torrents automatically saved to `/data/torrents`
@@ -67,6 +68,19 @@ docker buildx bake image-all
6768
| [Docker Hub](https://hub.docker.com/r/crazymax/qbittorrent/) | `crazymax/qbittorrent` |
6869
| [GitHub Container Registry](https://github.com/users/crazy-max/packages/container/package/qbittorrent) | `ghcr.io/crazy-max/qbittorrent` |
6970

71+
Following platforms for this image are available:
72+
73+
```
74+
$ docker run --rm mplatform/mquery crazymax/qbittorrent:latest
75+
Image: crazymax/qbittorrent:latest
76+
* Manifest List: Yes
77+
* Supported platforms:
78+
- linux/amd64
79+
- linux/arm/v6
80+
- linux/arm/v7
81+
- linux/arm64
82+
```
83+
7084
## Environment variables
7185

7286
* `TZ`: Timezone assigned to the container (default `UTC`)

docker-bake.hcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ target "image-local" {
2424
target "image-all" {
2525
inherits = ["image"]
2626
platforms = [
27-
"linux/amd64"
27+
"linux/amd64",
28+
"linux/arm/v6",
29+
"linux/arm/v7",
30+
"linux/arm64"
2831
]
2932
}

0 commit comments

Comments
 (0)