3.9 KiB
docker-rtorrent
This is plain simple rtorrent with proxy and custom rtorrent.rc
Base image: Alpine Linux 3.24 stable (alpine:3.24), including its latest patch updates.
Source: https://git.k2patel.in/k2patel/docker-rtorrent
Public access is read-only; account registration on this server is disabled. Report issues at https://github.com/k2patel/docker-rtorrent/issues. For contributions, open an issue with a link to your branch or patch on another Git provider. Changes are reviewed and applied by the maintainer on Gitea.
Gitea Actions builds and publishes docker.io/k2patel/rtorrent:latest
on pushes to main, manually, and monthly on the third day at 00:00 UTC.
The repository requires Actions secrets DOCKER_USERNAME and DOCKER_TOKEN
(a Docker Hub token with write access to k2patel/rtorrent).
Builds run on the remote Kubernetes runner for linux/amd64, matching the
previous GitHub build. Buildx pushes directly to Docker Hub without loading
the image into the runner's Docker image store. Its temporary builder and
build cache are removed after each job; no image archives or build records
are uploaded to Gitea, and no local container builds are required.
Latest 0.16 version caveat
- since version 0.16 explicitly set
network.bind_address.set = 0.0.0.0, when ipv6 is disabled on kernel.
Distroless runtime
docker.io/k2patel/rtorrent:latest is the only maintained image variant.
The default Dockerfile exports the Alpine 3.24 rTorrent binary, musl libraries,
CA certificates and timezone/terminal data into a scratch image. It contains
no shell, package manager, BusyBox, or build tools. The native launcher removes
the stale session lock and execs rTorrent; it also supplies the TCP health check.
CI starts rTorrent, runs the native public-IP helper through a scheduled
execute.capture hook, and verifies the resulting address over SCGI before
publication.
Use the default Compose file with the existing .env and mounted data:
docker compose pull
docker compose up -d --force-recreate
For an existing custom Compose file, use :latest for both images and replace
any shell-based rTorrent health check with:
healthcheck:
test: ["CMD", "/usr/local/bin/rtorrent-entrypoint", "--healthcheck"]
The separate :distroless tag and Compose overlay are retired. Both services in
the default Compose file now use distroless :latest. Root UID, HOME=/root,
SCGI port 5001, download paths and the session volume remain supported.
Mounted rtorrent.rc execute hooks must use programs available in the image;
shell commands and arbitrary external utilities are unavailable.
Public-IP reporting without a shell
The image includes /usr/local/bin/rtorrent-public-ip, a native libcurl helper.
It accepts URL [PROXY], limits connections to 5 seconds and the complete lookup
to 10 seconds, validates an IPv4 response, and prints it without a trailing newline.
Failed requests and invalid responses return an error instead of an address.
It does not require bash or the curl command-line executable.
Replace the old get_public_ip_address definition and ip_tick schedule in the
host file mounted at /root/.rtorrent.rc with the following (adjust the proxy):
method.insert = get_public_ip_address, simple|private, "execute.capture=/usr/local/bin/rtorrent-public-ip,https://ipv4.icanhazip.com,http://10.10.12.60:8118"
schedule2 = ip_tick, 0, 1800, "network.local_address.set=(get_public_ip_address)"
Remove or leave commented the old bash-based definition; do not define both. Pull and recreate the services from your Compose project after publication:
docker compose pull rtorrent
docker compose up -d --force-recreate rtorrent floodui
The image cannot replace a bind-mounted configuration. Updating the image alone
will not fix an existing execute.capture=bash,... hook. This migration preserves
public-IP reporting through the configured proxy while keeping the runtime shell-free.