Explorar o código

libtorrent:2.0.10 alpine:3.20

John hai 1 ano
pai
achega
b712e68d37
Modificáronse 2 ficheiros con 66 adicións e 0 borrados
  1. 50 0
      .github/workflows/libtorrent2.yml
  2. 16 0
      qBittorrent/Dockerfile.libtorrent2

+ 50 - 0
.github/workflows/libtorrent2.yml

@@ -0,0 +1,50 @@
+name: libtorrent2
+
+on:
+  push:
+    paths:
+    - 'qBittorrent/Dockerfile.libtorrent2'
+  workflow_dispatch:
+
+jobs:
+  job1:
+    name: buildx tag
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+
+      - name: 'Set env'
+        run: |
+          echo "LIBTORRENT_VER=$(echo `grep -n "LIBTORRENT_VER=" qBittorrent/Dockerfile.libtorrent2`|awk -F= '{print $2}')" >> $GITHUB_ENV
+          echo "ALPINE_VER=$(echo `grep -n "alpine" qBittorrent/Dockerfile.libtorrent2`|awk -F: '{print $3}')" >> $GITHUB_ENV
+
+      - name: Set up QEMU
+        id: qemu
+        uses: docker/setup-qemu-action@v2
+        with:
+          platforms: all
+
+      - name: Set up Docker Buildx
+        id: buildx
+        uses: docker/setup-buildx-action@v2
+        with:
+          version: latest
+
+      - name: Login to GHCR
+        uses: docker/login-action@v2
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Build and push
+        uses: docker/build-push-action@v3
+        with:
+          context: ./qBittorrent
+          file: ./qBittorrent/Dockerfile.libtorrent2
+          platforms: linux/amd64,linux/arm64,linux/arm/v7
+          push: true
+          tags: |
+            ghcr.io/gshang2017/libtorrent:2
+            ghcr.io/gshang2017/libtorrent:${{ env.LIBTORRENT_VER }}-alpine-${{ env.ALPINE_VER }}

+ 16 - 0
qBittorrent/Dockerfile.libtorrent2

@@ -0,0 +1,16 @@
+FROM alpine:3.20
+
+ARG LIBTORRENT_VER=2.0.10
+
+RUN apk add --no-cache --virtual libtorrentdep ca-certificates cmake build-base boost-dev wget openssl-dev samurai \
+#libtorrent-rasterbar
+&& mkdir -p /tmp/libtorrentbuild \
+&& wget -P /tmp/libtorrentbuild https://github.com/arvidn/libtorrent/releases/download/v${LIBTORRENT_VER}/libtorrent-rasterbar-${LIBTORRENT_VER}.tar.gz \
+&& tar -zxf /tmp/libtorrentbuild/libtorrent-rasterbar-${LIBTORRENT_VER}.tar.gz -C /tmp/libtorrentbuild \
+&& cd /tmp/libtorrentbuild/libtorrent-rasterbar-${LIBTORRENT_VER} \
+&& cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=/usr \
+&& cmake --build build -j $(nproc) \
+&& cmake --install build \
+&& strip /usr/lib/libtorrent-rasterbar.so.* \
+&& apk del libtorrentdep \
+&& rm -rf /var/cache/apk/* /tmp/*