feat: get the source code from Git

This commit is contained in:
Mogeko 2021-11-19 21:49:50 +00:00
parent 889566da16
commit eec1215c8f
No known key found for this signature in database
GPG key ID: B35485A88F40AD2C

View file

@ -1,35 +1,29 @@
FROM alpine:3.14 as libtorrent_builder FROM alpine:3.14 as libtorrent_builder
RUN apk add --no-cache \ RUN apk add --no-cache autoconf automake boost-dev build-base clang-dev libtool openssl-dev git
autoconf automake binutils boost-dev cppunit-dev libtool linux-headers ncurses-dev openssl-dev zlib-dev \
build-base clang tar
WORKDIR /workspace WORKDIR /workspace
ARG LIBTORRENT_VERSION ARG LIBTORRENT_VERSION
ADD https://github.com/arvidn/libtorrent/archive/refs/tags/v${LIBTORRENT_VERSION}.tar.gz /workspace ARG LIBTORRENT_GIT=https://github.com/arvidn/libtorrent.git
RUN tar -zxf v${LIBTORRENT_VERSION}.tar.gz -C . \ RUN git clone --depth 1 --recurse-submodules -b v${LIBTORRENT_VERSION} ${LIBTORRENT_GIT} .
&& cd libtorrent-${LIBTORRENT_VERSION} \ RUN ./autotool.sh \
&& ./autotool.sh \
&& ./configure CXXFLAGS="-std=c++14" --prefix=/workspace/pkg --with-libiconv \ && ./configure CXXFLAGS="-std=c++14" --prefix=/workspace/pkg --with-libiconv \
&& CC=clang make -j$(nproc) \ && CC=clang make -j$(nproc) \
&& make install-strip && make install-strip
FROM alpine:3.14 as qbittorrent_builder FROM alpine:3.14 as qbittorrent_builder
RUN apk add --no-cache \ RUN apk add --no-cache boost-dev qt5-qtbase-dev qt5-qttools-dev build-base clang git
boost-dev qt5-qtbase-dev qt5-qttools-dev \
build-base clang tar
WORKDIR /workspace
COPY --from=libtorrent_builder /workspace/pkg /usr COPY --from=libtorrent_builder /workspace/pkg /usr
WORKDIR /workspace
ARG QBITTORRENT_VERSION ARG QBITTORRENT_VERSION
ADD https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBITTORRENT_VERSION}.tar.gz /workspace ARG QBITTORRENT_GIT=https://github.com/qbittorrent/qBittorrent.git
RUN tar -zxf release-${QBITTORRENT_VERSION}.tar.gz -C . \ RUN git clone --depth 1 --recurse-submodules -b release-${QBITTORRENT_VERSION} ${QBITTORRENT_GIT} .
&& cd qBittorrent-release-${QBITTORRENT_VERSION} \ RUN ./configure --prefix=/workspace/pkg --disable-gui \
&& ./configure --prefix=/workspace/pkg --disable-gui \
&& CC=clang make -j$(nproc) \ && CC=clang make -j$(nproc) \
&& make install && make install
@ -37,8 +31,8 @@ FROM alpine:3.14
RUN apk add --no-cache busybox libgcc openssl qt5-qtbase zlib RUN apk add --no-cache busybox libgcc openssl qt5-qtbase zlib
COPY --from=libtorrent_builder /workspace/pkg /usr
COPY --from=qbittorrent_builder /workspace/pkg /usr COPY --from=qbittorrent_builder /workspace/pkg /usr
COPY --from=libtorrent_builder /workspace/pkg /usr
ADD --chown=1000:100 root / ADD --chown=1000:100 root /