2018-02-03 06:39:30 +00:00
# qBittorrent and OpenVPN
2014-11-09 15:23:18 +00:00
#
2018-02-06 06:35:55 +00:00
# Version 1.8
2014-11-09 15:23:18 +00:00
2021-03-23 03:40:02 +00:00
FROM alpine:edge
2018-02-02 07:54:32 +00:00
MAINTAINER MarkusMcNugen
2014-11-09 15:23:18 +00:00
2018-02-02 08:56:16 +00:00
VOLUME /downloads
2015-05-24 17:05:05 +00:00
VOLUME /config
2014-11-09 15:23:18 +00:00
2021-03-23 01:21:08 +00:00
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
2021-03-23 02:31:02 +00:00
RUN apk upgrade --no-cache
RUN apk add --no-cache --upgrade coreutils
RUN apk add --no-cache --upgrade bash
RUN apk add --no-cache --upgrade openvpn
RUN apk add --no-cache --upgrade openssl
RUN apk add --no-cache --upgrade iptables
RUN apk add --no-cache --upgrade shadow
RUN apk add --no-cache --upgrade boost-system
RUN apk add --no-cache --upgrade boost-thread
RUN apk add --no-cache --upgrade ca-certificates
RUN apk add --no-cache --upgrade unrar
RUN apk add --no-cache --upgrade findutils
RUN apk add --no-cache --upgrade perl
RUN apk add --no-cache --upgrade gawk
RUN apk add --no-cache --upgrade pacman
RUN apk add --no-cache --upgrade net-tools
2021-03-23 04:21:15 +00:00
RUN apk add --no-cache --upgrade tar
2021-03-23 01:37:20 +00:00
RUN update-ca-certificates
2018-02-12 05:53:44 +00:00
2018-02-11 23:03:56 +00:00
RUN usermod -u 99 nobody
2018-02-11 23:00:30 +00:00
2018-02-12 01:43:13 +00:00
# copy patches
COPY patches/ /tmp/patches
2018-02-11 23:00:30 +00:00
RUN buildDeps = " \
2018-02-12 00:54:06 +00:00
automake \
autoconf \
2018-02-12 01:02:04 +00:00
boost-dev \
2021-03-23 03:41:43 +00:00
clang \
2018-02-11 23:00:30 +00:00
curl \
2018-02-12 01:14:41 +00:00
cmake \
file \
2018-02-11 23:00:30 +00:00
g++ \
2018-02-12 01:40:54 +00:00
git \
2018-02-12 01:14:41 +00:00
geoip-dev \
2018-02-11 23:00:30 +00:00
gnutls-dev \
2018-02-12 00:57:21 +00:00
libtool \
2018-02-11 23:00:30 +00:00
linux-headers \
linux-pam-dev \
make \
2018-02-12 01:14:41 +00:00
qt5-qttools-dev \
2018-02-12 00:22:00 +00:00
qt5-qtbase-dev \
2018-02-11 23:00:30 +00:00
readline-dev \
xz \
" ; \
set -x \
2021-03-23 01:13:42 +00:00
&& apk add --update --virtual .build-deps $buildDeps
2021-03-23 04:05:59 +00:00
RUN export LIBTOR_VERSION = $( curl --silent "https://github.com/arvidn/libtorrent/tags" 2>& 1 | grep -m 1 'libtorrent-' | sed -e 's~^[t]*~~;s~[t]*$~~' | sed -n 's/.*href="\([^"]*\).*/\1/p' | sed 's!.*/!!' )
2021-03-23 04:52:40 +00:00
RUN curl -SL " https://github.com/arvidn/libtorrent/archive/ $LIBTOR_VERSION .tar.gz " -o libtor.tar.gz
2021-03-23 04:05:59 +00:00
RUN mkdir -p /usr/src/libtorrent
RUN tar -xzf libtor.tar.gz -C /usr/src/libtorrent --strip-components= 1
RUN rm libtor.tar.gz*
2021-03-23 04:30:05 +00:00
WORKDIR /usr/src/libtorrent/
2021-03-23 04:05:59 +00:00
RUN ./autotool.sh
RUN export LDFLAGS = -L/opt/local/lib
RUN export CXXFLAGS = -I/opt/local/include
RUN ./configure --disable-debug --enable-encryption --prefix= /usr
RUN make -j$( nproc)
RUN make install
RUN QBIT_VERSION = $( curl --silent "https://github.com/qbittorrent/qBittorrent/tags" 2>& 1 | grep -m 1 'release-' | sed -e 's~^[t]*~~;s~[t]*$~~' | sed -n 's/.*href="\([^"]*\).*/\1/p' | sed 's!.*/!!' )
2021-03-23 04:52:40 +00:00
RUN curl -SL " https://github.com/qbittorrent/qBittorrent/archive/ $QBIT_VERSION .tar.gz " -o qbittorrent.tar.gz
2021-03-23 04:05:59 +00:00
RUN mkdir -p /usr/src/qbittorrent
RUN tar -xzf qbittorrent.tar.gz -C /usr/src/qbittorrent --strip-components= 1
RUN rm qbittorrent.tar.gz*
2021-03-23 04:30:05 +00:00
WORKDIR /usr/src/qbittorrent/src/app
2021-03-23 04:05:59 +00:00
RUN patch -i /tmp/patches/main.patch
2021-03-23 04:30:05 +00:00
WORKDIR /usr/src/qbittorrent/
2021-03-23 04:05:59 +00:00
RUN ./configure --disable-gui --prefix= /usr
RUN make -j$( nproc)
RUN make install
2021-03-23 04:30:05 +00:00
WORKDIR /
2021-03-23 04:05:59 +00:00
RUN rm -rf /usr/src/libtorrent
RUN rm -rf /usr/src/qbittorrent
2021-03-23 01:13:42 +00:00
RUN runDeps = " $( \
2018-02-11 23:02:53 +00:00
scanelf --needed --nobanner /usr/local/bin/qbittorrent-nox \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| xargs -r apk info --installed \
| sort -u \
) " \
&& apk add --virtual .run-deps $runDeps gnutls-utils iptables \
&& apk del .build-deps \
2018-02-12 01:44:31 +00:00
&& rm -rf /var/cache/apk/* \
2018-02-12 01:43:13 +00:00
&& rm -rf /tmp/*
2014-11-16 13:19:56 +00:00
2014-11-09 18:52:52 +00:00
# Add configuration and scripts
2015-08-07 21:07:55 +00:00
ADD openvpn/ /etc/openvpn/
2018-02-03 00:56:08 +00:00
ADD qbittorrent/ /etc/qbittorrent/
2014-11-09 15:23:18 +00:00
2018-02-04 03:45:22 +00:00
RUN chmod +x /etc/qbittorrent/*.sh /etc/qbittorrent/*.init /etc/openvpn/*.sh
2018-02-03 05:26:50 +00:00
2018-02-03 02:55:43 +00:00
# Expose ports and run
2018-02-02 07:54:32 +00:00
EXPOSE 8080
2018-02-03 02:55:43 +00:00
EXPOSE 8999
EXPOSE 8999/udp
2018-02-03 05:37:37 +00:00
CMD [ "/bin/bash" , "/etc/openvpn/start.sh" ]