forked from sohrab-/docker-qbittorrent
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
83 lines (74 loc) · 2.49 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
77
78
79
80
81
82
83
FROM alpine:3.7
# Install required packages
RUN apk add --no-cache \
boost-system \
boost-thread \
ca-certificates \
dumb-init \
libressl \
qt5-qtbase
# Compiling qBitTorrent following instructions on
# https://github.com/qbittorrent/qBittorrent/wiki/Compiling-qBittorrent-on-Debian-and-Ubuntu#Libtorrent
RUN set -x \
# Install build dependencies
&& apk add --no-cache -t .build-deps \
boost-dev \
curl \
cmake \
g++ \
make \
libressl-dev \
# Build lib rasterbar from source code (required by qBittorrent)
# Until https://github.com/qbittorrent/qBittorrent/issues/6132 is fixed, need to use version 1.0.*
&& LIBTORRENT_RASTERBAR_URL="https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_1_7/libtorrent-rasterbar-1.1.7.tar.gz" \
&& mkdir /tmp/libtorrent-rasterbar \
&& curl -sSL $LIBTORRENT_RASTERBAR_URL | tar xzC /tmp/libtorrent-rasterbar \
&& cd /tmp/libtorrent-rasterbar/* \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make install \
# Clean-up
&& cd / \
&& apk del --purge .build-deps \
&& rm -rf /tmp/*
RUN set -x \
# Install build dependencies
&& apk add --no-cache -t .build-deps \
boost-dev \
g++ \
git \
make \
libressl-dev \
qt5-qttools-dev \
# Build qBittorrent from source code
&& git clone https://github.com/qbittorrent/qBittorrent.git /tmp/qbittorrent \
&& cd /tmp/qbittorrent \
&& git checkout release-4.1.0 \
# Compile
&& PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --disable-gui --disable-stacktrace \
&& make install \
# Clean-up
&& cd / \
&& apk del --purge .build-deps \
&& rm -rf /tmp/* \
# Add non-root user
&& adduser -S -D -u 520 -g 520 -s /sbin/nologin qbittorrent \
# Create symbolic links to simplify mounting
&& mkdir -p /home/qbittorrent/.config/qBittorrent \
&& mkdir -p /home/qbittorrent/.local/share/data/qBittorrent \
&& mkdir /downloads \
&& chmod go+rw -R /home/qbittorrent /downloads \
&& ln -s /home/qbittorrent/.config/qBittorrent /config \
&& ln -s /home/qbittorrent/.local/share/data/qBittorrent /torrents \
# 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"]
ENV HOME=/home/qbittorrent
USER qbittorrent
EXPOSE 8080 6881
ENTRYPOINT ["dumb-init", "/entrypoint.sh"]
CMD ["qbittorrent-nox"]