forked from sohrab-/docker-qbittorrent
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathDockerfile
76 lines (68 loc) · 2.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM alpine:3.4
# Install required packages
RUN apk add --no-cache \
boost-system \
boost-thread \
ca-certificates \
qt5-qtbase
COPY main.patch /
RUN set -x \
# Install build dependencies
&& apk add --no-cache -t deps \
boost-dev \
curl \
cmake \
g++ \
make \
qt5-qttools-dev \
\
# Install dumb-init
# https://github.com/Yelp/dumb-init
&& curl -Lo /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 \
&& chmod +x /usr/local/bin/dumb-init \
\
# Build lib rasterbar from source code (required by qBittorrent)
&& LIBTORRENT_RASTERBAR_URL='https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_10/libtorrent-rasterbar-1.0.10.tar.gz' \
&& curl -L $LIBTORRENT_RASTERBAR_URL | tar xzC /tmp \
&& cd /tmp/libtorrent-rasterbar* \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make install \
\
# Build qBittorrent from source code
&& QBITTORRENT_URL='http://sourceforge.net/projects/qbittorrent/files/qbittorrent/qbittorrent-3.3.7/qbittorrent-3.3.7.tar.xz/download' \
&& curl -L $QBITTORRENT_URL | tar xJC /tmp \
&& cd /tmp/qbittorrent* \
&& ln -s /usr/bin/lrelease /usr/bin/lrelease-qt4 \
&& PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --disable-gui \
# Patch: Disable stack trace because it requires libexecline-dev which isn't available on Alpine 3.4.
&& cd src/app \
&& patch -i /main.patch \
&& rm /main.patch \
&& cd ../.. \
&& make install \
\
# Clean-up
&& cd / \
&& apk del --purge deps \
&& rm -rf /tmp/* \
\
# Add non-root user
&& adduser -S -D -u 520 -s /sbin/nologin qbittorrent \
\
# Create symbolic links to simplify mounting
&& ln -s /home/qbittorrent/.config/qBittorrent /config \
&& ln -s /home/qbittorrent/.local/share/data/qBittorrent /torrents \
&& mkdir /downloads && chown qbittorrent /downloads \
\
# Check it works
&& su qbittorrent -s /bin/sh -c 'qbittorrent-nox -v'
# Default configuration file.
COPY qBittorrent.conf /default/qBittorrent.conf
COPY entrypoint.sh /
VOLUME ["/config", "/torrents", "/downloads"]
EXPOSE 8080 6881
USER qbittorrent
ENTRYPOINT ["dumb-init", "/entrypoint.sh"]
CMD ["qbittorrent-nox"]