Skip to content

Commit

Permalink
Merge pull request #139 from stickz/dumptorrent
Browse files Browse the repository at this point in the history
dumptorrent: Add software for ruTorrent v5.1 plugin
  • Loading branch information
Rathorian authored Nov 30, 2024
2 parents 8f31a05 + 19fa9ee commit e81bb51
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG MKTORRENT_VERSION=v1.1
ARG DUMP_TORRENT_VERSION=302ac444a20442edb4aeabef65b264a85ab88ce9

# Create src image to retreive source files
FROM alpine:3.20 AS src
RUN apk --update --no-cache add curl git tar tree xz
RUN apk --update --no-cache add curl git tar sed tree xz
WORKDIR /src

# Retreive source files for mktorrent
Expand All @@ -11,6 +12,14 @@ RUN git init . && git remote add origin "https://github.com/pobrn/mktorrent.git"
ARG MKTORRENT_VERSION
RUN git fetch origin "${MKTORRENT_VERSION}" && git checkout -q FETCH_HEAD

# Retreive source files for dumptorrent. Repair build for alpine Linux.
FROM src AS src-dump-torrent
RUN git init . && git remote add origin "https://github.com/TheGoblinHero/dumptorrent.git"
ARG DUMP_TORRENT_VERSION
RUN git fetch origin "${DUMP_TORRENT_VERSION}" && git checkout -q FETCH_HEAD
RUN sed -i '1i #include <sys/time.h>' scrapec.c
RUN rm -rf .git*

FROM alpine:3.20 AS builder

ENV DIST_PATH="/dist"
Expand Down Expand Up @@ -40,6 +49,13 @@ RUN make install -j$(nproc)
RUN make DESTDIR=${DIST_PATH} install -j$(nproc)
RUN tree ${DIST_PATH}

# Build and install dump torrent for ruTorrent plugin
WORKDIR /usr/local/src/dump-torrent
COPY --from=src-dump-torrent /src .
RUN make dumptorrent -j$(nproc)
RUN cp dumptorrent ${DIST_PATH}/usr/local/bin
RUN tree ${DIST_PATH}

FROM alpine:3.20

LABEL description="rutorrent based on alpinelinux" \
Expand Down

0 comments on commit e81bb51

Please sign in to comment.