Files
computer-playbook/cli/mirror/sync/__main__.py
T
kevinveenbirkenbach 221c1c67aa feat(cli): add flexible docker image mirror resolver and sync system
Introduce a modular mirror subsystem with:
- canonical ImageRef model
- shared discovery & normalization logic for Docker Hub images
- pluggable registry providers (GHCR, Gitea-ready)
- inventory resolver for mirrored image paths
- skopeo-based mirror sync implementation

Design follows SRP/KISS principles and allows future registry backends.

https://chatgpt.com/share/6971e6cf-be18-800f-9419-589fd3e22c3d
2026-01-22 09:58:48 +01:00

27 lines
690 B
Python

from __future__ import annotations
import argparse
from pathlib import Path
from cli.mirror.util import iter_role_images
from cli.mirror.providers import GHCRProvider
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--repo-root", default=".")
parser.add_argument("--ghcr-namespace", required=True)
parser.add_argument("--ghcr-prefix", default="mirror")
args = parser.parse_args()
provider = GHCRProvider(args.ghcr_namespace, args.ghcr_prefix)
repo_root = Path(args.repo_root).resolve()
for img in iter_role_images(repo_root):
provider.mirror(img)
return 0
if __name__ == "__main__":
raise SystemExit(main())