2022-05-05 06:02:57 +03:00
|
|
|
# image for building
|
2022-04-25 06:39:25 +03:00
|
|
|
FROM alpine:latest AS builder
|
|
|
|
|
2022-05-05 06:02:57 +03:00
|
|
|
ARG QBT_VERSION
|
|
|
|
|
|
|
|
# alpine linux qbittorrent package: https://git.alpinelinux.org/aports/tree/community/qbittorrent/APKBUILD
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
apk --update-cache add \
|
|
|
|
boost-dev \
|
|
|
|
cmake \
|
|
|
|
g++ \
|
|
|
|
libtorrent-rasterbar-dev \
|
|
|
|
ninja \
|
|
|
|
qt6-qtbase-dev \
|
|
|
|
qt6-qttools-dev
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
if [ "$QBT_VERSION" = "devel" ]; then \
|
|
|
|
wget https://github.com/qbittorrent/qBittorrent/archive/refs/heads/master.zip && \
|
|
|
|
unzip master.zip && \
|
|
|
|
cd qBittorrent-master ; \
|
|
|
|
else \
|
|
|
|
wget "https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBT_VERSION}.tar.gz" && \
|
|
|
|
tar -xf "release-${QBT_VERSION}.tar.gz" && \
|
|
|
|
cd "qBittorrent-release-${QBT_VERSION}" ; \
|
|
|
|
fi && \
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G Ninja \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DGUI=OFF \
|
|
|
|
-DQT6=ON \
|
|
|
|
-DSTACKTRACE=OFF && \
|
|
|
|
cmake --build build && \
|
|
|
|
cmake --install build
|
|
|
|
|
|
|
|
# image for running
|
2022-04-25 06:39:25 +03:00
|
|
|
FROM alpine:latest
|
|
|
|
|
2022-05-05 06:02:57 +03:00
|
|
|
RUN \
|
|
|
|
apk --no-cache add \
|
2022-05-05 08:30:18 +03:00
|
|
|
doas \
|
2022-05-05 06:02:57 +03:00
|
|
|
libtorrent-rasterbar \
|
2022-05-05 14:50:05 +03:00
|
|
|
python3 \
|
2022-05-05 06:02:57 +03:00
|
|
|
qt6-qtbase \
|
2022-05-05 14:50:05 +03:00
|
|
|
tini
|
|
|
|
|
|
|
|
RUN \
|
2022-05-05 08:30:18 +03:00
|
|
|
adduser \
|
|
|
|
-D \
|
|
|
|
-H \
|
|
|
|
-s /sbin/nologin \
|
|
|
|
-u 1000 \
|
|
|
|
qbtUser && \
|
|
|
|
echo "permit nopass :root" >> "/etc/doas.d/doas.conf"
|
2022-05-05 06:02:57 +03:00
|
|
|
|
2022-04-25 06:39:25 +03:00
|
|
|
COPY --from=builder /usr/local/bin/qbittorrent-nox /usr/bin/qbittorrent-nox
|
|
|
|
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
|
2022-05-05 06:02:57 +03:00
|
|
|
ENTRYPOINT ["/sbin/tini", "-g", "--", "/entrypoint.sh"]
|