[CI Ubuntu] Strip installed components
[qBittorrent.git] / dist / docker / Dockerfile
blobe5111d4dd0537e2c1b995dfb5b860f2b1e398ab9
1 # image for building
2 FROM alpine:latest AS builder
4 ARG QBT_VERSION
6 # alpine linux qbittorrent package: https://git.alpinelinux.org/aports/tree/community/qbittorrent/APKBUILD
8 RUN \
9   apk --update-cache add \
10     boost-dev \
11     cmake \
12     g++ \
13     libtorrent-rasterbar-dev \
14     ninja \
15     qt6-qtbase-dev \
16     qt6-qttools-dev
18 RUN \
19   if [ "$QBT_VERSION" = "devel" ]; then \
20     wget https://github.com/qbittorrent/qBittorrent/archive/refs/heads/master.zip && \
21     unzip master.zip && \
22     cd qBittorrent-master ; \
23   else \
24     wget "https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBT_VERSION}.tar.gz" && \
25     tar -xf "release-${QBT_VERSION}.tar.gz" && \
26     cd "qBittorrent-release-${QBT_VERSION}" ; \
27   fi && \
28   cmake \
29     -B build \
30     -G Ninja \
31     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
32     -DGUI=OFF \
33     -DQT6=ON \
34     -DSTACKTRACE=OFF && \
35   cmake --build build && \
36   cmake --install build
38 # image for running
39 FROM alpine:latest
41 RUN \
42   apk --no-cache add \
43     doas \
44     libtorrent-rasterbar \
45     python3 \
46     qt6-qtbase \
47     tini
49 RUN \
50   adduser \
51     -D \
52     -H \
53     -s /sbin/nologin \
54     -u 1000 \
55     qbtUser && \
56   echo "permit nopass :root" >> "/etc/doas.d/doas.conf"
58 COPY --from=builder /usr/local/bin/qbittorrent-nox /usr/bin/qbittorrent-nox
60 COPY entrypoint.sh /entrypoint.sh
62 ENTRYPOINT ["/sbin/tini", "-g", "--", "/entrypoint.sh"]