|
| 1 | +ARG LIBTORRENT_VERSION=1 |
| 2 | +FROM nevinee/libtorrent-rasterbar:${LIBTORRENT_VERSION} AS builder |
| 3 | +RUN apk upgrade \ |
| 4 | + && apk add --no-cache \ |
| 5 | + boost-dev \ |
| 6 | + openssl-dev \ |
| 7 | + qt5-qtbase-dev \ |
| 8 | + qt5-qttools-dev \ |
| 9 | + g++ \ |
| 10 | + cmake \ |
| 11 | + curl \ |
| 12 | + tar \ |
| 13 | + samurai \ |
| 14 | + && rm -rf /tmp/* /var/cache/apk/* |
| 15 | +ARG QBITTORRENT_VERSION |
| 16 | +RUN mkdir -p /tmp/qbittorrent \ |
| 17 | + && cd /tmp/qbittorrent \ |
| 18 | + && curl -sSL https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBITTORRENT_VERSION}.tar.gz | tar xz --strip-components 1 \ |
| 19 | + && cmake \ |
| 20 | + -DCMAKE_BUILD_TYPE=Release \ |
| 21 | + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ |
| 22 | + -DCMAKE_CXX_STANDARD=17 \ |
| 23 | + -DWEBUI=ON \ |
| 24 | + -DVERBOSE_CONFIGURE=OFF \ |
| 25 | + -DSTACKTRACE=OFF \ |
| 26 | + -DDBUS=OFF \ |
| 27 | + -DGUI=OFF \ |
| 28 | + -DQT6=OFF \ |
| 29 | + -Brelease \ |
| 30 | + -GNinja \ |
| 31 | + && cmake --build release -j $(nproc) \ |
| 32 | + && cmake --install release \ |
| 33 | + && ls -al /usr/local/bin/ \ |
| 34 | + && qbittorrent-nox --help |
| 35 | +RUN echo "Copy to /out" \ |
| 36 | + && strip /usr/local/lib/libtorrent-rasterbar.so.* \ |
| 37 | + && strip /usr/local/bin/qbittorrent-nox \ |
| 38 | + && mkdir -p /out/usr/lib /out/usr/bin \ |
| 39 | + && cp -d /usr/local/lib/libtorrent-rasterbar.so* /out/usr/lib \ |
| 40 | + && cp /usr/local/bin/qbittorrent-nox /out/usr/bin |
| 41 | + |
| 42 | +FROM alpine:latest AS app |
| 43 | +ENV QBT_PROFILE=/home/qbittorrent \ |
| 44 | + TZ=Asia/Shanghai \ |
| 45 | + PUID=1000 \ |
| 46 | + PGID=100 \ |
| 47 | + WEBUI_PORT=8080 \ |
| 48 | + BT_PORT=34567 \ |
| 49 | + QB_USERNAME=admin \ |
| 50 | + QB_PASSWORD=adminadmin \ |
| 51 | + LANG=zh_CN.UTF-8 \ |
| 52 | + SHELL=/bin/bash \ |
| 53 | + PS1="\u@\h:\w \$ " |
| 54 | +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.bfsu.edu.cn/g' /etc/apk/repositories \ |
| 55 | + && apk add --no-cache \ |
| 56 | + bash \ |
| 57 | + busybox-suid \ |
| 58 | + curl \ |
| 59 | + jq \ |
| 60 | + openssl \ |
| 61 | + python3 \ |
| 62 | + qt5-qtbase \ |
| 63 | + shadow \ |
| 64 | + su-exec \ |
| 65 | + tini \ |
| 66 | + tzdata \ |
| 67 | + && rm -rf /tmp/* /var/cache/apk/* \ |
| 68 | + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ |
| 69 | + && echo "${TZ}" > /etc/timezone \ |
| 70 | + && useradd qbittorrent -u ${PUID} -U -m -d ${QBT_PROFILE} -s /sbin/nologin |
| 71 | +COPY --from=builder /out / |
| 72 | +COPY root / |
| 73 | +WORKDIR /data |
| 74 | +VOLUME ["/data"] |
| 75 | +ENTRYPOINT ["tini", "-g", "--", "entrypoint.sh"] |
0 commit comments