/
Dockerfile
39 lines (35 loc) 路 1.89 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
# Instructions on building libtorrent:
# https://github.com/qbittorrent/qBittorrent/wiki/Compiling-qBittorrent-on-Debian-and-Ubuntu#libtorrent
# https://discourse.osmc.tv/t/howto-update-compile-qbittorrent-nox/19726/3
# https://git.alpinelinux.org/aports/tree/testing/libtorrent-rasterbar/APKBUILD
FROM alpine:3.11.6@sha256:39eda93d15866957feaee28f8fc5adb545276a64147445c64992ef69804dbf01
ARG VERSION=1.2.[0-9]+
SHELL ["/bin/ash", "-euo", "pipefail", "-c"]
# Build libtorrent-rasterbar-dev
# hadolint ignore=DL3003,DL3018,SC2169
RUN apk --update add --no-cache boost-system libgcc libstdc++ openssl && \
apk --update add --no-cache --virtual build-dependencies autoconf automake boost-dev coreutils file g++ gcc git libtool make openssl-dev && \
# Checkout from source
cd "$(mktemp -d)" && \
git clone https://github.com/arvidn/libtorrent.git && \
cd libtorrent && \
git checkout "$(git tag --sort=-version:refname | grep "${VERSION}" | head -1)" && \
# Run autoconf/automake, configure, and make
./autotool.sh && \
for PYTHON_VERSION in $(seq 2 3); do \
(apk --update add --no-cache "python${PYTHON_VERSION}" "boost-python${PYTHON_VERSION}" && \
apk --update add --no-cache --virtual python-dependencies "python${PYTHON_VERSION}-dev" && \
./configure \
--prefix=/usr \
--with-libiconv \
--enable-python-binding \
--with-boost-python="$(find /usr/lib -maxdepth 1 -name "libboost_python${PYTHON_VERSION/2/}*.so*" | sort | head -1 | sed 's/.*.\/lib\(.*\)\.so.*/\1/')" \
PYTHON="$(which "python${PYTHON_VERSION}")" && \
make "-j$(nproc)" && \
make install-strip && \
apk del --purge python-dependencies) || exit 1; \
done && \
# Remove temp files
cd && \
apk del --purge build-dependencies && \
rm -rf /tmp/*