Skip to content

Commit

Permalink
Add qbittorrent image
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Apr 22, 2024
1 parent 46384c7 commit 5c1e96f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
42 changes: 42 additions & 0 deletions images/qbittorrent/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
4 changes: 4 additions & 0 deletions images/qbittorrent/latest.sh
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 5c1e96f

Please sign in to comment.