docker-qBittorrentvpn/Dockerfile

110 lines
3.5 KiB
Docker
Raw Normal View History

2018-02-03 06:39:30 +00:00
# qBittorrent and OpenVPN
#
2018-02-06 06:35:55 +00:00
# Version 1.8
2021-03-23 02:31:02 +00:00
FROM alpine:latest
2018-02-02 07:54:32 +00:00
MAINTAINER MarkusMcNugen
2018-02-02 08:56:16 +00:00
VOLUME /downloads
VOLUME /config
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
2021-03-23 03:04:44 +00:00
RUN apk add --no-cache --upgrade clang
2021-03-23 02:31:02 +00:00
RUN apk add --no-cache --upgrade net-tools
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 \
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 \
tar \
xz \
"; \
set -x \
2021-03-23 01:13:42 +00:00
&& apk add --update --virtual .build-deps $buildDeps
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!.*/!!') \
2018-02-11 23:02:53 +00:00
&& curl -L "https://github.com/arvidn/libtorrent/archive/$LIBTOR_VERSION.tar.gz" -o libtor.tar.gz \
2018-02-11 23:00:30 +00:00
&& mkdir -p /usr/src/libtorrent \
2018-02-11 23:02:53 +00:00
&& tar -xzf libtor.tar.gz -C /usr/src/libtorrent --strip-components=1 \
2018-02-11 23:00:30 +00:00
&& rm libtor.tar.gz* \
2018-02-11 23:02:53 +00:00
&& cd /usr/src/libtorrent/ \
2018-02-12 00:56:08 +00:00
&& ./autotool.sh \
2018-02-12 00:54:06 +00:00
&& export LDFLAGS=-L/opt/local/lib \
&& export CXXFLAGS=-I/opt/local/include \
2018-02-12 01:40:54 +00:00
&& ./configure --disable-debug --enable-encryption --prefix=/usr \
2018-02-12 01:49:35 +00:00
&& make -j$(nproc) \
2018-02-12 02:43:07 +00:00
&& make install \
&& 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!.*/!!') \
2018-02-12 02:07:22 +00:00
&& curl -L "https://github.com/qbittorrent/qBittorrent/archive/$QBIT_VERSION.tar.gz" -o qbittorrent.tar.gz \
&& mkdir -p /usr/src/qbittorrent \
&& tar -xzf qbittorrent.tar.gz -C /usr/src/qbittorrent --strip-components=1 \
&& rm qbittorrent.tar.gz* \
2018-02-12 03:19:03 +00:00
&& cd /usr/src/qbittorrent/src/app \
2018-02-12 03:28:40 +00:00
&& patch -i /tmp/patches/main.patch \
2018-02-12 01:44:31 +00:00
&& cd /usr/src/qbittorrent/ \
2018-02-12 01:40:54 +00:00
&& ./configure --disable-gui --prefix=/usr \
2018-02-11 23:02:53 +00:00
&& make -j$(nproc) \
2018-02-12 01:40:54 +00:00
&& make install \
2018-02-11 23:00:30 +00:00
&& cd / \
2018-02-11 23:02:53 +00:00
&& rm -rf /usr/src/libtorrent \
2021-03-23 01:13:42 +00:00
&& rm -rf /usr/src/qbittorrent
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/*
# Add configuration and scripts
ADD openvpn/ /etc/openvpn/
ADD qbittorrent/ /etc/qbittorrent/
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"]