blumeops/.dagger/src/blumeops_ci/main.py
Erich Blume 16e6a336cc Adopt Dagger CI for container builds (Phase 1)
Replace the Docker buildx + skopeo composite action with a Dagger Python
module for building and publishing container images. BuildKit's native
push is compatible with Zot, eliminating the skopeo workaround entirely.

- Add Dagger Python module (.dagger/) with build/publish functions
- Update build-container.yaml workflow to use `dagger call publish`
- Add Dagger CLI to forgejo-runner image (v0.19.11)
- Bump runner version to v2.6.0 in ExternalSecret
- Add GPLv3 LICENSE
- Add dagger to mise.toml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:35:51 -08:00

24 lines
765 B
Python

import dagger
from dagger import function, object_type
@object_type
class BlumeopsCi:
@function
def build(self, src: dagger.Directory, container_name: str) -> dagger.Container:
"""Build a container from containers/<name>/Dockerfile."""
context = src.directory(f"containers/{container_name}")
return context.docker_build()
@function
async def publish(
self,
src: dagger.Directory,
container_name: str,
version: str,
registry: str = "registry.ops.eblu.me",
) -> str:
"""Build and push to registry. Returns the image ref."""
ctr = self.build(src, container_name)
ref = f"{registry}/blumeops/{container_name}:{version}"
return await ctr.publish(ref)