Migrate transmission containers from Dockerfile to Dagger builds
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

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>
This commit is contained in:
Erich Blume 2026-04-15 11:26:00 -07:00
commit 2c483cefff
6 changed files with 89 additions and 66 deletions

View file

@ -1,25 +0,0 @@
# Transmission Prometheus exporter - collect-on-scrape, no polling loop
# uv run --script handles dependency resolution at runtime
ARG CONTAINER_APP_VERSION=1.0.1
FROM python:3.13-alpine3.23
ARG CONTAINER_APP_VERSION
LABEL org.opencontainers.image.title="Transmission Exporter"
LABEL org.opencontainers.image.description="Prometheus exporter for Transmission BitTorrent client"
LABEL org.opencontainers.image.version="${CONTAINER_APP_VERSION}"
LABEL org.opencontainers.image.source="https://forge.eblu.me/eblume/blumeops"
LABEL org.opencontainers.image.vendor="blumeops"
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV PYTHONUNBUFFERED=1
ENV UV_CACHE_DIR=/tmp/uv-cache
WORKDIR /app
COPY exporter.py .
EXPOSE 19091
USER 65534:65534
CMD ["uv", "run", "--script", "/app/exporter.py"]

View file

@ -0,0 +1,37 @@
"""Transmission Prometheus exporter — native Dagger build.
Minimal collect-on-scrape exporter using uv to resolve deps at runtime.
"""
import dagger
from dagger import dag
from blumeops.containers import oci_labels
VERSION = "1.0.1"
PYTHON_BASE = "python:3.14-alpine3.23"
UV_IMAGE = "ghcr.io/astral-sh/uv:0.11.6"
async def build(src: dagger.Directory) -> dagger.Container:
ctr = (
dag.container()
.from_(PYTHON_BASE)
.with_file("/usr/local/bin/uv", dag.container().from_(UV_IMAGE).file("/uv"))
.with_env_variable("PYTHONUNBUFFERED", "1")
.with_env_variable("UV_CACHE_DIR", "/tmp/uv-cache")
.with_workdir("/app")
.with_file(
"/app/exporter.py", src.file("containers/transmission-exporter/exporter.py")
)
.with_exposed_port(19091)
.with_user("65534:65534")
.with_default_args(args=["uv", "run", "--script", "/app/exporter.py"])
)
return oci_labels(
ctr,
title="Transmission Exporter",
description="Prometheus exporter for Transmission BitTorrent client",
version=VERSION,
)