ARG PREFIX=/usr/local FROM alpine as builder ARG PREFIX RUN apk add build-base python3 git linux-headers boost boost-build boost-dev WORKDIR /libtorrent RUN git clone --recurse-submodules https://github.com/arvidn/libtorrent.git RUN cd libtorrent &&\ b2 variant=release cxxstd=17 link=shared runtime-link=shared -j 32 RUN cd libtorrent && \ b2 variant=release cxxstd=17 link=shared runtime-link=shared install --prefix=${PREFIX} # Create a new image with no dependencies and copy over the built files FROM sirdavidludwig/qt-alpine:5.15.2 as qt-libtorrent-alpine ARG PREFIX COPY --from=builder ${PREFIX} ${PREFIX} ENV PATH "$PATH:${PREFIX}/bin" ENV CPLUS_INCLUDE_PATH "$CPLUS_INCLUDE_PATH:${PREFIX}/include" ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:${PREFIX}/lib"