diff --git a/daemon/Dockerfile b/daemon/Dockerfile index 1a7bb8ac37be1dfbff4a7141dc2ee971659c0bd0..69d4d6a85182489982dbe21bab382f880707f19d 100644 --- a/daemon/Dockerfile +++ b/daemon/Dockerfile @@ -1,43 +1,3 @@ -FROM alpine:3.15 AS builder -ARG RTORRENT_VERSION=0.9.8 -ARG LIBTORRENT_VERSION=0.13.8 -RUN apk add --no-cache \ - alpine-sdk \ - autoconf \ - automake \ - curl-dev \ - libsigc++-dev \ - libtool \ - linux-headers \ - ncurses-dev \ - openssl-dev \ - xmlrpc-c-dev \ - zlib-dev - -RUN git clone --branch v${RTORRENT_VERSION} --single-branch https://github.com/rakshasa/rtorrent.git /rtorrent -RUN git clone --branch v${LIBTORRENT_VERSION} --single-branch https://github.com/rakshasa/libtorrent.git /libtorrent - -WORKDIR /libtorrent -RUN ./autogen.sh && \ - ./configure \ - --prefix=/usr \ - --disable-debug \ - --disable-instrumentation && \ - make -j$(nproc) && \ - mkdir -p /build && \ - DESTDIR=/build make install && \ - make install - -WORKDIR /rtorrent -RUN ./autogen.sh && \ - ./configure \ - --prefix=/usr \ - --disable-debug \ - --with-xmlrpc-c && \ - make -j$(nproc) && \ - mkdir -p /build && \ - DESTDIR=/build make install - FROM alpine:3.15 RUN apk add --no-cache \ @@ -48,13 +8,13 @@ RUN apk add --no-cache \ ncurses-libs \ xmlrpc-c -COPY --from=builder /build/usr/bin/rtorrent /usr/bin/rtorrent -COPY --from=builder /build/usr/lib/libtorrent.so* /usr/lib/ +RUN curl -L https://github.com/jesec/rtorrent/releases/latest/download/rtorrent-linux-amd64 > /usr/bin/rtorrent && \ + chmod +x /usr/bin/rtorrent RUN adduser -u 1000 -D rtorrent && \ addgroup rtorrent rtorrent && \ mkdir -p /data && chown rtorrent /data && \ - mkdir -p /private && chown rtorrent /private + mkdir -p /session && chown rtorrent /session USER rtorrent diff --git a/daemon/entrypoint.sh b/daemon/entrypoint.sh index 7f44c86cc322d03adb9818c17aebafd7977aa899..f46a00bbf52162965a125feccec14292f8b45815 100755 --- a/daemon/entrypoint.sh +++ b/daemon/entrypoint.sh @@ -6,6 +6,7 @@ rm /session/rtorrent.lock /session/rtorrent.pid || true if [ -n "$EXTERNAL_IP_CMD" ]; then EXTERNAL_IP=$(eval "$EXTERNAL_IP_CMD") + echo "external ip: ${EXTERNAL_IP}" fi if [ -n "$EXTERNAL_IP" ]; then rtorrent -i "$EXTERNAL_IP" -n -o "import=/rtorrent.rc" &