forked from linuxserver/docker-qbittorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (66 loc) · 2.04 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
FROM ghcr.io/linuxserver/baseimage-alpine:edge
# set version label
ARG BUILD_DATE
ARG VERSION
ARG QBITTORRENT_VERSION
ARG QBT_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"
# environment settings
ARG UNRAR_VERSION=6.1.7
ENV HOME="/config" \
XDG_CONFIG_HOME="/config" \
XDG_DATA_HOME="/config"
# install runtime packages and qbitorrent-cli
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --upgrade --virtual=build-dependencies \
make \
g++ \
gcc && \
echo "**** install packages ****" && \
apk add -U --update --no-cache \
icu-libs \
libstdc++ \
openssl \
openssl1.1-compat \
p7zip \
python3 && \
echo "**** install unrar from source ****" && \
mkdir /tmp/unrar && \
curl -o \
/tmp/unrar.tar.gz -L \
"https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \
tar xf \
/tmp/unrar.tar.gz -C \
/tmp/unrar --strip-components=1 && \
cd /tmp/unrar && \
make && \
install -v -m755 unrar /usr/bin && \
if [ -z ${QBITTORRENT_VERSION+x} ]; then \
QBITTORRENT_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:qbittorrent-nox$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add -U --upgrade --no-cache \
qbittorrent-nox==${QBITTORRENT_VERSION} && \
echo "***** install qbitorrent-cli ****" && \
mkdir /qbt && \
QBT_VERSION=$(curl -sL "https://api.github.com/repos/fedarovich/qbittorrent-cli/releases" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
curl -o \
/tmp/qbt.tar.gz -L \
"https://github.com/fedarovich/qbittorrent-cli/releases/download/${QBT_VERSION}/qbt-linux-alpine-x64-${QBT_VERSION:1}.tar.gz" && \
tar xf \
/tmp/qbt.tar.gz -C \
/qbt && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache \
/tmp/*
# add local files
COPY root/ /
# ports and volumes
EXPOSE 8080 6881 6881/udp
VOLUME /config