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>
24 lines
765 B
Python
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)
|