docker – Blame information for rev 62
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
62 | office | 1 | # syntax=docker/dockerfile:1 |
2 | |||
3 | ARG LIBSIG_VERSION=3.0.3 |
||
4 | ARG CARES_VERSION=1.34.5 |
||
5 | ARG CURL_VERSION=8.12.1 |
||
6 | ARG MKTORRENT_VERSION=v1.1 |
||
7 | ARG GEOIP2_PHPEXT_VERSION=1.3.1 |
||
8 | |||
9 | # v5.2.7 |
||
10 | ARG RUTORRENT_VERSION=407059b6bd7ca5c5ec994abad3d11c992e6d752f |
||
11 | ARG GEOIP2_RUTORRENT_VERSION=4ff2bde530bb8eef13af84e4413cedea97eda148 |
||
12 | ARG DUMP_TORRENT_VERSION=302ac444a20442edb4aeabef65b264a85ab88ce9 |
||
13 | |||
14 | # libtorrent v0.15.3 |
||
15 | ARG LIBTORRENT_VERSION=756f70010779927dc0691e1e722ed433d5d295e1 |
||
16 | # rtorrent v0.15.3 |
||
17 | ARG RTORRENT_VERSION=6154d1698756e0c4842b1c13a0e56db93f1aa947 |
||
18 | |||
19 | ARG ALPINE_VERSION=3.21 |
||
20 | ARG ALPINE_S6_VERSION=${ALPINE_VERSION}-2.2.0.3 |
||
21 | |||
22 | FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS src |
||
23 | RUN apk --update --no-cache add curl git tar tree sed xz |
||
24 | WORKDIR /src |
||
25 | |||
26 | FROM src AS src-libsig |
||
27 | ARG LIBSIG_VERSION |
||
28 | RUN curl -sSL "https://download.gnome.org/sources/libsigc%2B%2B/3.0/libsigc%2B%2B-${LIBSIG_VERSION}.tar.xz" | tar xJv --strip 1 |
||
29 | |||
30 | FROM src AS src-cares |
||
31 | ARG CARES_VERSION |
||
32 | RUN curl -sSL "https://github.com/c-ares/c-ares/releases/download/v${CARES_VERSION}/c-ares-${CARES_VERSION}.tar.gz" | tar xz --strip 1 |
||
33 | |||
34 | FROM src AS src-curl |
||
35 | ARG CURL_VERSION |
||
36 | RUN curl -sSL "https://curl.se/download/curl-${CURL_VERSION}.tar.gz" | tar xz --strip 1 |
||
37 | |||
38 | FROM src AS src-libtorrent |
||
39 | RUN git init . && git remote add origin "https://github.com/rakshasa/libtorrent.git" |
||
40 | ARG LIBTORRENT_VERSION |
||
41 | RUN git fetch origin "${LIBTORRENT_VERSION}" && git checkout -q FETCH_HEAD |
||
42 | |||
43 | FROM src AS src-rtorrent |
||
44 | RUN git init . && git remote add origin "https://github.com/rakshasa/rtorrent.git" |
||
45 | ARG RTORRENT_VERSION |
||
46 | RUN git fetch origin "${RTORRENT_VERSION}" && git checkout -q FETCH_HEAD |
||
47 | |||
48 | FROM src AS src-mktorrent |
||
49 | RUN git init . && git remote add origin "https://github.com/pobrn/mktorrent.git" |
||
50 | ARG MKTORRENT_VERSION |
||
51 | RUN git fetch origin "${MKTORRENT_VERSION}" && git checkout -q FETCH_HEAD |
||
52 | |||
53 | FROM src AS src-geoip2-phpext |
||
54 | RUN git init . && git remote add origin "https://github.com/rlerdorf/geoip.git" |
||
55 | ARG GEOIP2_PHPEXT_VERSION |
||
56 | RUN git fetch origin "${GEOIP2_PHPEXT_VERSION}" && git checkout -q FETCH_HEAD |
||
57 | |||
58 | FROM src AS src-rutorrent |
||
59 | RUN git init . && git remote add origin "https://github.com/Novik/ruTorrent.git" |
||
60 | ARG RUTORRENT_VERSION |
||
61 | RUN git fetch origin "${RUTORRENT_VERSION}" && git checkout -q FETCH_HEAD |
||
62 | RUN rm -rf .git* conf/users plugins/geoip share |
||
63 | |||
64 | FROM src AS src-geoip2-rutorrent |
||
65 | RUN git init . && git remote add origin "https://github.com/Micdu70/geoip2-rutorrent.git" |
||
66 | ARG GEOIP2_RUTORRENT_VERSION |
||
67 | RUN git fetch origin "${GEOIP2_RUTORRENT_VERSION}" && git checkout -q FETCH_HEAD |
||
68 | RUN rm -rf .git* |
||
69 | |||
70 | FROM src AS src-mmdb |
||
71 | RUN curl -SsOL "https://github.com/crazy-max/geoip-updater/raw/mmdb/GeoLite2-City.mmdb" \ |
||
72 | && curl -SsOL "https://github.com/crazy-max/geoip-updater/raw/mmdb/GeoLite2-Country.mmdb" |
||
73 | |||
74 | FROM src AS src-dump-torrent |
||
75 | RUN git init . && git remote add origin "https://github.com/TheGoblinHero/dumptorrent.git" |
||
76 | ARG DUMP_TORRENT_VERSION |
||
77 | RUN git fetch origin "${DUMP_TORRENT_VERSION}" && git checkout -q FETCH_HEAD |
||
78 | RUN sed -i '1i #include <sys/time.h>' scrapec.c |
||
79 | RUN rm -rf .git* |
||
80 | |||
81 | FROM crazymax/alpine-s6:${ALPINE_S6_VERSION} AS builder |
||
82 | RUN apk --update --no-cache add \ |
||
83 | autoconf \ |
||
84 | automake \ |
||
85 | binutils \ |
||
86 | brotli-dev \ |
||
87 | build-base \ |
||
88 | cppunit-dev \ |
||
89 | cppunit \ |
||
90 | cmake \ |
||
91 | gd-dev \ |
||
92 | geoip-dev \ |
||
93 | libpsl-dev \ |
||
94 | libtool \ |
||
95 | libxslt-dev \ |
||
96 | linux-headers \ |
||
97 | ncurses-dev \ |
||
98 | nghttp2-dev \ |
||
99 | openssl-dev \ |
||
100 | pcre-dev \ |
||
101 | php83-dev \ |
||
102 | php83-pear \ |
||
103 | tar \ |
||
104 | tree \ |
||
105 | xz \ |
||
106 | zlib-dev \ |
||
107 | xmlrpc-c \ |
||
108 | xmlrpc-c-dev \ |
||
109 | libcurl \ |
||
110 | distcc |
||
111 | |||
112 | ENV DIST_PATH="/dist" |
||
113 | ENV DISTCC_HOSTS="docker1.internal:35001 docker2.internal:35002" |
||
114 | ENV CC="distcc" |
||
115 | ENV CXX="distcc g++" |
||
116 | |||
117 | WORKDIR /usr/local/src/libsig |
||
118 | COPY --from=src-libsig /src . |
||
119 | RUN ./configure |
||
120 | RUN make -j$(nproc) |
||
121 | RUN make install -j$(nproc) |
||
122 | RUN make DESTDIR=${DIST_PATH} install -j$(nproc) |
||
123 | RUN tree ${DIST_PATH} |
||
124 | |||
125 | WORKDIR /usr/local/src/cares |
||
126 | COPY --from=src-cares /src . |
||
127 | RUN cmake . -D CARES_SHARED=ON -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -flto=\"$(nproc)\" -pipe" |
||
128 | RUN cmake --build . --clean-first --parallel $(nproc) |
||
129 | RUN make install -j$(nproc) |
||
130 | RUN make DESTDIR=${DIST_PATH} install -j$(nproc) |
||
131 | RUN tree ${DIST_PATH} |
||
132 | |||
133 | WORKDIR /usr/local/src/curl |
||
134 | COPY --from=src-curl /src . |
||
135 | RUN cmake . -D ENABLE_ARES=ON -D CURL_LTO=ON -D CURL_USE_OPENSSL=ON -D CURL_BROTLI=ON -D CURL_ZSTD=ON -D BUILD_SHARED_LIBS=ON -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -flto=\"$(nproc)\" -pipe" |
||
136 | RUN cmake --build . --clean-first --parallel $(nproc) |
||
137 | RUN make install -j$(nproc) |
||
138 | RUN make DESTDIR=${DIST_PATH} install -j$(nproc) |
||
139 | RUN tree ${DIST_PATH} |
||
140 | |||
141 | WORKDIR /usr/local/src/libtorrent |
||
142 | COPY --from=src-libtorrent /src . |
||
143 | RUN autoreconf -vfi |
||
144 | RUN ./configure --enable-aligned |
||
145 | RUN make -j$(nproc) CXXFLAGS="-w -O3 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" |
||
146 | RUN make install -j$(nproc) |
||
147 | RUN make DESTDIR=${DIST_PATH} install -j$(nproc) |
||
148 | RUN tree ${DIST_PATH} |
||
149 | |||
150 | WORKDIR /usr/local/src/rtorrent |
||
151 | COPY --from=src-rtorrent /src . |
||
152 | RUN autoreconf -vfi |
||
153 | RUN ./configure --with-xmlrpc-c --with-ncurses --with-libcurl |
||
154 | RUN make -j$(nproc) CXXFLAGS="-w -O3 -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" |
||
155 | RUN make install -j$(nproc) |
||
156 | RUN make DESTDIR=${DIST_PATH} install -j$(nproc) |
||
157 | RUN tree ${DIST_PATH} |
||
158 | |||
159 | WORKDIR /usr/local/src/mktorrent |
||
160 | COPY --from=src-mktorrent /src . |
||
161 | RUN echo "CC = gcc" >> Makefile |
||
162 | RUN echo "CFLAGS = -w -flto -O3" >> Makefile |
||
163 | RUN echo "USE_PTHREADS = 1" >> Makefile |
||
164 | RUN echo "USE_OPENSSL = 1" >> Makefile |
||
165 | RUN make -j$(nproc) |
||
166 | RUN make install -j$(nproc) |
||
167 | RUN make DESTDIR=${DIST_PATH} install -j$(nproc) |
||
168 | RUN tree ${DIST_PATH} |
||
169 | |||
170 | WORKDIR /usr/local/src/geoip2-phpext |
||
171 | COPY --from=src-geoip2-phpext /src . |
||
172 | RUN <<EOT |
||
173 | set -e |
||
174 | phpize83 |
||
175 | ./configure |
||
176 | make |
||
177 | make install |
||
178 | EOT |
||
179 | RUN mkdir -p ${DIST_PATH}/usr/lib/php83/modules |
||
180 | RUN cp -f /usr/lib/php83/modules/geoip.so ${DIST_PATH}/usr/lib/php83/modules/ |
||
181 | RUN tree ${DIST_PATH} |
||
182 | |||
183 | WORKDIR /usr/local/src/dump-torrent |
||
184 | COPY --from=src-dump-torrent /src . |
||
185 | RUN make dumptorrent -j$(nproc) |
||
186 | RUN cp dumptorrent ${DIST_PATH}/usr/local/bin |
||
187 | RUN tree ${DIST_PATH} |
||
188 | |||
189 | FROM crazymax/alpine-s6:${ALPINE_S6_VERSION} |
||
190 | COPY --from=builder /dist / |
||
191 | COPY --from=src-rutorrent --chown=nobody:nogroup /src /var/www/rutorrent |
||
192 | COPY --from=src-geoip2-rutorrent --chown=nobody:nogroup /src /var/www/rutorrent/plugins/geoip2 |
||
193 | COPY --from=src-mmdb /src /var/mmdb |
||
194 | |||
195 | ENV PYTHONPATH="$PYTHONPATH:/var/www/rutorrent" \ |
||
196 | S6_BEHAVIOUR_IF_STAGE2_FAILS="2" \ |
||
197 | S6_KILL_GRACETIME="10000" \ |
||
198 | TZ="UTC" \ |
||
199 | PUID="1000" \ |
||
200 | PGID="1000" |
||
201 | |||
202 | # increase rmem_max and wmem_max for rTorrent configuration |
||
203 | RUN echo "net.core.rmem_max = 67108864" >> /etc/sysctl.conf \ |
||
204 | && echo "net.core.wmem_max = 67108864" >> /etc/sysctl.conf \ |
||
205 | && sysctl -p |
||
206 | |||
207 | # unrar package is not available since alpine 3.15 |
||
208 | # dhclient package is not available since alpine 3.21 |
||
209 | RUN echo "@314 http://dl-cdn.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories \ |
||
210 | && echo "@320 http://dl-cdn.alpinelinux.org/alpine/v3.20/main" >> /etc/apk/repositories \ |
||
211 | && apk --update --no-cache add unrar@314 dhclient@320 |
||
212 | |||
213 | RUN apk --update --no-cache add \ |
||
214 | apache2-utils \ |
||
215 | bash \ |
||
216 | bind-tools \ |
||
217 | binutils \ |
||
218 | brotli \ |
||
219 | ca-certificates \ |
||
220 | coreutils \ |
||
221 | ffmpeg \ |
||
222 | findutils \ |
||
223 | geoip \ |
||
224 | grep \ |
||
225 | gzip \ |
||
226 | libstdc++ \ |
||
227 | mediainfo \ |
||
228 | ncurses \ |
||
229 | nginx \ |
||
230 | nginx-mod-http-dav-ext \ |
||
231 | nginx-mod-http-geoip2 \ |
||
232 | openssl \ |
||
233 | php83 \ |
||
234 | php83-bcmath \ |
||
235 | php83-ctype \ |
||
236 | php83-curl \ |
||
237 | php83-dom \ |
||
238 | php83-fileinfo \ |
||
239 | php83-fpm \ |
||
240 | php83-mbstring \ |
||
241 | php83-openssl \ |
||
242 | php83-phar \ |
||
243 | php83-posix \ |
||
244 | php83-session \ |
||
245 | php83-sockets \ |
||
246 | php83-xml \ |
||
247 | php83-zip \ |
||
248 | python3 \ |
||
249 | py3-pip \ |
||
250 | shadow \ |
||
251 | sox \ |
||
252 | tar \ |
||
253 | tzdata \ |
||
254 | unzip \ |
||
255 | util-linux \ |
||
256 | zip \ |
||
257 | cppunit=1.15.1-r4 \ |
||
258 | xmlrpc-c \ |
||
259 | && pip3 install --upgrade --break-system-packages pip \ |
||
260 | && pip3 install --break-system-packages cfscrape cloudscraper \ |
||
261 | && addgroup -g ${PGID} rtorrent \ |
||
262 | && adduser -D -H -u ${PUID} -G rtorrent -s /bin/sh rtorrent \ |
||
263 | && curl --version \ |
||
264 | && rm -rf /tmp/* |
||
265 | |||
266 | COPY rootfs / |
||
267 | |||
268 | VOLUME [ "/data", "/downloads", "/passwd" ] |
||
269 | ENTRYPOINT [ "/init" ] |
||
270 | |||
271 | HEALTHCHECK --interval=30s --timeout=20s --start-period=10s \ |
||
272 | CMD /usr/local/bin/healthcheck |