FROM alpine:3.20.2 AS base FROM base AS builder # renovate: datasource=github-tags depName=transmission packageName=transmission/transmission ENV TRANSMISSION_VERSION=4.0.6 # Install base utilities and dependencies to build transmission RUN set -ex && \ apk add --no-cache --upgrade \ git \ python3 \ build-base \ cmake \ curl-dev \ gettext-dev \ openssl-dev \ linux-headers \ samurai # Get transmission source code from GitHub using the specified tag RUN git clone \ --branch ${TRANSMISSION_VERSION} \ --depth 1 \ --recurse-submodules \ https://github.com/transmission/transmission.git \ /usr/src/transmission WORKDIR /usr/src/transmission # Build transmission RUN cmake \ -S . \ -B obj \ -G Ninja \ -D CMAKE_BUILD_TYPE=Release \ -D ENABLE_CLI=OFF \ -D ENABLE_DAEMON=ON \ -D ENABLE_GTK=OFF \ -D ENABLE_MAC=OFF \ -D ENABLE_QT=OFF \ -D ENABLE_TESTS=OFF \ -D ENABLE_UTILS=OFF \ -D ENABLE_UTP=ON \ -D ENABLE_WERROR=OFF \ -D ENABLE_DEPRECATED=OFF \ -D ENABLE_NLS=ON \ -D INSTALL_WEB=ON \ -D REBUILD_WEB=OFF \ -D INSTALL_DOC=OFF \ -D INSTALL_LIB=OFF \ -D RUN_CLANG_TIDY=OFF \ -D WITH_INOTIFY=ON \ -D WITH_CRYPTO="openssl" \ -D WITH_SYSTEMD=OFF \ && cmake --build obj --config Release \ && cmake --build obj --config Release --target install/strip FROM base AS runtime RUN set -ex && \ apk update && \ apk add --no-cache --upgrade libcurl libintl libgcc libstdc++ COPY --from=builder /usr/local/bin /usr/local/bin COPY --from=builder /usr/local/share /usr/local/share EXPOSE 9091/tcp 51413/tcp 51413/udp VOLUME [ "/root/config", "/root/Downloads" ] STOPSIGNAL SIGTERM ENTRYPOINT ["/usr/local/bin/transmission-daemon", "--foreground", "--config-dir", "/root/config"]