forked from kfei/docktorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
108 lines (93 loc) · 3.61 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
FROM debian:jessie
MAINTAINER kfei <[email protected]>
ENV VER_LIBTORRENT 0.13.4
ENV VER_RTORRENT 0.9.4
ENV VER_RUTORRENT 3.6
WORKDIR /usr/local/src
# This long disgusting instruction saves your image ~130 MB
RUN build_deps="automake build-essential libc-ares-dev libcppunit-dev libtool"; \
build_deps="${build_deps} libssl-dev libxml2-dev libncurses5-dev pkg-config subversion wget"; \
set -x && \
apt-get update && apt-get install -q -y --no-install-recommends ${build_deps} && \
wget http://curl.haxx.se/download/curl-7.39.0.tar.gz && \
tar xzvfp curl-7.39.0.tar.gz && \
cd curl-7.39.0 && \
./configure --enable-ares --enable-tls-srp --enable-gnu-tls --with-zlib --with-ssl && \
make && \
make install && \
cd .. && \
rm -rf curl-* && \
ldconfig && \
svn --trust-server-cert checkout https://svn.code.sf.net/p/xmlrpc-c/code/stable/ xmlrpc-c && \
cd xmlrpc-c && \
./configure --enable-libxml2-backend --disable-abyss-server --disable-cgi-server && \
make && \
make install && \
cd .. && \
rm -rf xmlrpc-c && \
ldconfig && \
wget http://libtorrent.rakshasa.no/downloads/libtorrent-$VER_LIBTORRENT.tar.gz && \
tar xzf libtorrent-$VER_LIBTORRENT.tar.gz && \
cd libtorrent-$VER_LIBTORRENT && \
./autogen.sh && \
./configure --with-posix-fallocate && \
make && \
make install && \
cd .. && \
rm -rf libtorrent-* && \
ldconfig && \
wget http://libtorrent.rakshasa.no/downloads/rtorrent-$VER_RTORRENT.tar.gz && \
tar xzf rtorrent-$VER_RTORRENT.tar.gz && \
cd rtorrent-$VER_RTORRENT && \
./autogen.sh && \
./configure --with-xmlrpc-c --with-ncurses && \
make && \
make install && \
cd .. && \
rm -rf rtorrent-* && \
ldconfig && \
mkdir -p /usr/share/nginx/html && \
cd /usr/share/nginx/html && \
curl -L -O http://dl.bintray.com/novik65/generic/rutorrent-$VER_RUTORRENT.tar.gz && \
curl -L -O http://dl.bintray.com/novik65/generic/plugins-$VER_RUTORRENT.tar.gz && \
tar xzvpf rutorrent-$VER_RUTORRENT.tar.gz && \
tar xzvpf plugins-$VER_RUTORRENT.tar.gz -C rutorrent/ && \
rm -rf *.tar.gz && \
apt-get purge -y --auto-remove ${build_deps} && \
apt-get autoremove -y
# Install required packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
apache2-utils \
libc-ares2 \
nginx \
php5-cli \
php5-fpm
# Install packages for ruTorrent plugins
RUN apt-get update && apt-get install -q -y --no-install-recommends \
mediainfo \
unrar-free \
unzip
# For ffmpeg, which is required by the ruTorrent screenshots plugin
# This increases ~53 MB of the image size, remove it if you really don't need screenshots
RUN echo "deb http://www.deb-multimedia.org jessie main" >> /etc/apt/sources.list && \
apt-get update && apt-get install -q -y --force-yes --no-install-recommends \
deb-multimedia-keyring \
ffmpeg
# IMPORTANT: Change the default login/password of ruTorrent before build
RUN htpasswd -cb /usr/share/nginx/html/rutorrent/.htpasswd docktorrent p@ssw0rd
# Copy config files
COPY config/nginx/default /etc/nginx/sites-available/default
COPY config/rtorrent/.rtorrent.rc /root/.rtorrent.rc
COPY config/rutorrent/config.php /usr/share/nginx/html/rutorrent/conf/config.php
# Add the s6 binaries fs layer
ADD s6-1.1.3.2-musl-static.tar.xz /
# Service directories and the wrapper script
COPY rootfs /
# Run the wrapper script first
ENTRYPOINT ["/usr/local/bin/docktorrent"]
# Declare ports to expose
EXPOSE 80 9527 45566
# Declare volumes
VOLUME ["/rtorrent", "/var/log"]
# This should be removed in the latest version of Docker
ENV HOME /root