docker-qBittorrentvpn/Dockerfile

78 lines
2.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
2018-02-11 23:00:30 +00:00
FROM alpine:3.7
2018-02-02 07:54:32 +00:00
MAINTAINER MarkusMcNugen
2018-02-02 08:56:16 +00:00
VOLUME /downloads
VOLUME /config
2018-02-11 23:00:30 +00:00
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories \
&& echo "http://dl-4.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \
2018-02-12 00:29:01 +00:00
&& apk add --update bash openvpn iptables shadow apk-tools
2018-02-11 23:03:56 +00:00
RUN usermod -u 99 nobody
2018-02-11 23:00:30 +00:00
RUN buildDeps=" \
boost \
boost-build \
curl \
g++ \
gnutls-dev \
gpgme \
libev-dev \
libnl3-dev \
libseccomp-dev \
linux-headers \
linux-pam-dev \
lz4-dev \
make \
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 \
2018-02-11 23:02:53 +00:00
&& apk add --update --virtual .build-deps $buildDeps \
&& 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:00:30 +00:00
&& export 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-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
&& curl -L "https://github.com/qbittorrent/qBittorrent/archive/$QBIT_VERSION.tar.gz" -o qbittorrent.tar.gz \
&& mkdir -p /usr/src/libtorrent \
&& mkdir -p /usr/src/qbittorrent \
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
&& tar -xzf qbittorrent.tar.gz -C /usr/src/qbittorrent --strip-components=1 \
&& rm libtor.tar.gz* \
2018-02-11 23:02:53 +00:00
&& rm qbittorrent.tar.gz* \
&& cd /usr/src/libtorrent/ \
2018-02-11 23:05:14 +00:00
&& b2 install \
2018-02-11 23:00:30 +00:00
&& cd /usr/src/qbittorrent/ \
2018-02-11 23:02:53 +00:00
&& ./configure --disable-gui \
&& make -j$(nproc) \
2018-02-11 23:00:30 +00:00
&& make install \
&& cd / \
2018-02-11 23:02:53 +00:00
&& rm -rf /usr/src/libtorrent \
2018-02-11 23:00:30 +00:00
&& rm -rf /usr/src/qbittorrent \
2018-02-11 23:02:53 +00:00
&& runDeps="$( \
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-11 23:00:30 +00:00
&& rm -rf /var/cache/apk/*
# 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"]