From 5c1e96fd27f110726e38533872823f7cb136a31d Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Mon, 22 Apr 2024 21:33:11 +0200 Subject: [PATCH] Add qbittorrent image --- images/qbittorrent/Dockerfile | 42 +++++++++++++++++++++++++++++++++++ images/qbittorrent/latest.sh | 4 ++++ 2 files changed, 46 insertions(+) create mode 100644 images/qbittorrent/Dockerfile create mode 100755 images/qbittorrent/latest.sh diff --git a/images/qbittorrent/Dockerfile b/images/qbittorrent/Dockerfile new file mode 100644 index 0000000..b5bed2e --- /dev/null +++ b/images/qbittorrent/Dockerfile @@ -0,0 +1,42 @@ +ARG GOLANG_VERSION +FROM golang:$GOLANG_VERSION as builder + +ARG TARGETARCH +ARG RELEASE +ARG CHISEL_VERSION + +# Install chisel and build rootfs +RUN \ + go install github.com/canonical/chisel/cmd/chisel@${CHISEL_VERSION} \ + && mkdir /rootfs \ + && chisel cut \ + --release ubuntu-24.04 \ + --root /rootfs \ + base-files_base \ + base-files_release-info \ + ca-certificates_data \ + && useradd \ + --root /rootfs \ + --system \ + --no-create-home \ + --uid 1000 \ + nonroot \ + && rm /rootfs/etc/.pwd.lock \ + && mkdir -p /rootfs/config/qBittorrent/config \ + && chown -R 1000 /rootfs/config + +# Download qbittorrent +RUN \ + case "${TARGETARCH}" in \ + 'amd64') export ARCH='x86_64' ;; \ + 'arm64') export ARCH='aarch64' ;; \ + esac \ + && curl -L -o /qbittorrent-nox "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${RELEASE}/${ARCH}-qbittorrent-nox" \ + && chmod +x /qbittorrent-nox + +FROM scratch +COPY --from=builder /rootfs / +COPY --from=builder /qbittorrent-nox /bin/qbittorrent-nox + +USER nonroot +ENTRYPOINT ["/bin/qbittorrent-nox", "--profile=/config"] diff --git a/images/qbittorrent/latest.sh b/images/qbittorrent/latest.sh new file mode 100755 index 0000000..acc907b --- /dev/null +++ b/images/qbittorrent/latest.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail + +curl -s "https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest" | jq -r '.tag_name'