forked from DyonR/docker-qbittorrentvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
119 lines (109 loc) · 3.65 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# qBittorrent, OpenVPN and WireGuard, qbittorrentvpn
FROM ubuntu:22.04
WORKDIR /opt
RUN usermod -u 99 nobody
# Make directories
RUN mkdir -p /downloads /config/qBittorrent /etc/openvpn /etc/qbittorrent
# Install build dependencies, build libtorrent-rasterbar and qbittorrent
RUN apt update \
&& apt upgrade -y \
&& apt install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
g++ \
jq \
libxml2-utils \
libboost-all-dev \
ninja-build \
cmake \
libssl-dev \
pkg-config \
qtbase5-dev \
qttools5-dev \
qtbase5-private-dev \
libqt5svg5-dev \
zlib1g-dev \
&& LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | select(.target_commitish=="RC_1_2") | .assets_url' | head -n 1 | tr -d '"') \
&& LIBTORRENT_DOWNLOAD_URL=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .browser_download_url' | tr -d '"') \
&& LIBTORRENT_NAME=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .name' | tr -d '"') \
&& curl -o /opt/${LIBTORRENT_NAME} -L ${LIBTORRENT_DOWNLOAD_URL} \
&& tar -xzf /opt/${LIBTORRENT_NAME} \
&& rm /opt/${LIBTORRENT_NAME} \
&& cd /opt/libtorrent-rasterbar* \
&& cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_CXX_STANDARD=17 \
&& cmake --build build --parallel $(nproc) \
&& cmake --install build \
&& cd /opt \
&& QBITTORRENT_RELEASE=$(curl -sX GET "https://api.github.com/repos/qBittorrent/qBittorrent/tags" | jq '.[] | select(.name | index ("alpha") | not) | select(.name | index ("beta") | not) | select(.name | index ("rc") | not) | .name' | head -n 1 | tr -d '"') \
&& curl -o /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz -L "https://github.com/qbittorrent/qBittorrent/archive/${QBITTORRENT_RELEASE}.tar.gz" \
&& tar -xzf /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz \
&& rm /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz \
&& cd /opt/qBittorrent-${QBITTORRENT_RELEASE} \
&& cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DGUI=OFF -DCMAKE_CXX_STANDARD=17 \
&& cmake --build build --parallel $(nproc) \
&& cmake --install build \
&& apt-get clean \
&& apt --purge autoremove -y \
&& apt purge -y \
build-essential \
curl \
ca-certificates \
g++ \
jq \
libxml2-utils \
libboost-all-dev \
ninja-build \
cmake \
libssl-dev \
pkg-config \
qtbase5-dev \
qttools5-dev \
libqt5svg5-dev \
qtbase5-private-dev \
zlib1g-dev \
&& apt-get clean \
&& apt --purge autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
# Install WireGuard and some other dependencies some of the scripts in the container rely on.
RUN apt update \
&& apt install -y --no-install-recommends \
ca-certificates \
dos2unix \
inetutils-ping \
ipcalc \
iptables \
kmod \
libqt5network5 \
libqt5xml5 \
libqt5sql5 \
libssl-dev \
moreutils \
net-tools \
openresolv \
openvpn \
procps \
wireguard-tools \
unrar \
p7zip-full \
unzip \
zip \
&& apt-get clean \
&& apt --purge autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
# Remove src_valid_mark from wg-quick
RUN sed -i /net\.ipv4\.conf\.all\.src_valid_mark/d `which wg-quick`
VOLUME /config /downloads
ADD openvpn/ /etc/openvpn/
ADD qbittorrent/ /etc/qbittorrent/
RUN chmod +x /etc/qbittorrent/*.sh /etc/qbittorrent/*.init /etc/openvpn/*.sh
EXPOSE 8080
EXPOSE 8999
EXPOSE 8999/udp
CMD ["/bin/bash", "/etc/openvpn/start.sh"]