Skip to content

Commit

Permalink
Merge pull request #130 from stickz/mktorrent
Browse files Browse the repository at this point in the history
mktorrent: Build with pthreads
  • Loading branch information
Rathorian authored Nov 28, 2024
2 parents 1d821a8 + 07272dd commit 67b68d0
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
FROM alpine:3.20 AS builder

ARG MKTORRENT_VERSION=v1.1
ARG UNRAR_VER=7.0.9

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

# Retreive source files for mktorrent
FROM src AS src-mktorrent
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

FROM alpine:3.20 AS builder

RUN apk --update --no-cache add \
autoconf \
automake \
Expand All @@ -21,6 +33,16 @@ RUN apk --update --no-cache add \
&& make -f makefile \
&& install -Dm 755 unrar /usr/bin/unrar

# Build and install mktorrent with pthreads
WORKDIR /usr/local/src/mktorrent
COPY --from=src-mktorrent /src .
RUN echo "CC = gcc" >> Makefile
RUN echo "CFLAGS = -w -flto -O3" >> Makefile
RUN echo "USE_PTHREADS = 1" >> Makefile
RUN echo "USE_OPENSSL = 1" >> Makefile
RUN make -j$(nproc)
RUN make install -j$(nproc)

FROM alpine:3.20

LABEL description="rutorrent based on alpinelinux" \
Expand Down Expand Up @@ -59,7 +81,6 @@ RUN apk --update --no-cache add \
libzen \
libzen-dev \
mediainfo \
mktorrent \
nginx \
openssl \
php82 \
Expand Down

0 comments on commit 67b68d0

Please sign in to comment.