blumeops/containers/transmission/container.py
Erich Blume 2c483cefff
All checks were successful
Build Container / detect (push) Successful in 3s
Build Container / build-dagger (transmission-exporter) (push) Successful in 2m29s
Build Container / build-dagger (transmission) (push) Successful in 2m29s
Migrate transmission containers from Dockerfile to Dagger builds
Replace Dockerfiles with native container.py for both transmission and
transmission-exporter. Updates base images (Alpine 3.23, Python 3.14),
pins uv to 0.11.6 instead of :latest.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:26:00 -07:00

49 lines
1.5 KiB
Python

"""Transmission BitTorrent daemon — native Dagger build.
Alpine-based container with transmission-daemon from edge repo.
Includes start.sh for dynamic PUID/PGID user creation at runtime.
"""
import dagger
from dagger import dag
from blumeops.containers import oci_labels
VERSION = "4.1.1-r1"
ALPINE_BASE = "alpine:3.23"
async def build(src: dagger.Directory) -> dagger.Container:
ctr = (
dag.container()
.from_(ALPINE_BASE)
# Transmission 4.1.x is only in edge community
.with_exec(
[
"apk",
"add",
"--no-cache",
"--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community",
f"transmission-daemon={VERSION}",
f"transmission-cli={VERSION}",
f"transmission-remote={VERSION}",
]
)
.with_exec(["apk", "add", "--no-cache", "bash", "curl", "tzdata", "su-exec"])
.with_exec(
["mkdir", "-p", "/config", "/downloads/complete", "/downloads/incomplete"]
)
.with_file("/start.sh", src.file("containers/transmission/start.sh"))
.with_exec(["chmod", "+x", "/start.sh"])
.with_exposed_port(9091)
.with_exposed_port(51413, protocol=dagger.NetworkProtocol.TCP)
.with_exposed_port(51413, protocol=dagger.NetworkProtocol.UDP)
.with_default_args(args=["/start.sh"])
)
return oci_labels(
ctr,
title="Transmission",
description="Transmission BitTorrent daemon",
version=VERSION,
)