# OCI Registry Service\n\nComprehensive OCI (Open Container Initiative) registry deployment and management for the provisioning system.\n\n> **Source**: `provisioning/platform/oci-registry/`\n\n## Supported Registries\n\n- **Zot** (Recommended for Development): Lightweight, fast, OCI-native with UI\n- **Harbor** (Recommended for Production): Full-featured enterprise registry\n- **Distribution** (OCI Reference): Official OCI reference implementation\n\n## Features\n\n- **Multi-Registry Support**: Zot, Harbor, Distribution\n- **Namespace Organization**: Logical separation of artifacts\n- **Access Control**: RBAC, policies, authentication\n- **Monitoring**: Prometheus metrics, health checks\n- **Garbage Collection**: Automatic cleanup of unused artifacts\n- **High Availability**: Optional HA configurations\n- **TLS/SSL**: Secure communication\n- **UI Interface**: Web-based management (Zot, Harbor)\n\n## Quick Start\n\n### Start Zot Registry (Default)\n\n```\ncd provisioning/platform/oci-registry/zot\ndocker-compose up -d\n\n# Initialize with namespaces and policies\nnu ../scripts/init-registry.nu --registry-type zot\n\n# Access UI\nopen http://localhost:5000\n```\n\n### Start Harbor Registry\n\n```\ncd provisioning/platform/oci-registry/harbor\ndocker-compose up -d\nsleep 120  # Wait for services\n\n# Initialize\nnu ../scripts/init-registry.nu --registry-type harbor --admin-password Harbor12345\n\n# Access UI\nopen http://localhost\n# Login: admin / Harbor12345\n```\n\n## Default Namespaces\n\n| Namespace | Description | Public | Retention |\n| ----------- | ------------- | -------- | ----------- |\n| `provisioning-extensions` | Extension packages | No | 10 tags, 90 days |\n| `provisioning-kcl` | KCL schemas | No | 20 tags, 180 days |\n| `provisioning-platform` | Platform images | No | 5 tags, 30 days |\n| `provisioning-test` | Test artifacts | Yes | 3 tags, 7 days |\n\n## Management\n\n### Nushell Commands\n\n```\n# Start registry\nnu -c "use provisioning/core/nulib/lib_provisioning/oci_registry; oci-registry start --type zot"\n\n# Check status\nnu -c "use provisioning/core/nulib/lib_provisioning/oci_registry; oci-registry status --type zot"\n\n# View logs\nnu -c "use provisioning/core/nulib/lib_provisioning/oci_registry; oci-registry logs --type zot --follow"\n\n# Health check\nnu -c "use provisioning/core/nulib/lib_provisioning/oci_registry; oci-registry health --type zot"\n\n# List namespaces\nnu -c "use provisioning/core/nulib/lib_provisioning/oci_registry; oci-registry namespaces"\n```\n\n### Docker Compose\n\n```\n# Start\ndocker-compose up -d\n\n# Stop\ndocker-compose down\n\n# View logs\ndocker-compose logs -f\n\n# Remove (including volumes)\ndocker-compose down -v\n```\n\n## Registry Comparison\n\n| Feature | Zot | Harbor | Distribution |\n| --------- | ----- | -------- | -------------- |\n| **Setup** | Simple | Complex | Simple |\n| **UI** | Built-in | Full-featured | None |\n| **Search** | Yes | Yes | No |\n| **Scanning** | No | Trivy | No |\n| **Replication** | No | Yes | No |\n| **RBAC** | Basic | Advanced | Basic |\n| **Best For** | Dev/CI | Production | Compliance |\n\n## Security\n\n### Authentication\n\n**Zot/Distribution (htpasswd)**:\n\n```\nhtpasswd -Bc htpasswd provisioning\ndocker login localhost:5000\n```\n\n**Harbor (Database)**:\n\n```\ndocker login localhost\n# Username: admin / Password: Harbor12345\n```\n\n## Monitoring\n\n### Health Checks\n\n```\n# API check\ncurl http://localhost:5000/v2/\n\n# Catalog check\ncurl http://localhost:5000/v2/_catalog\n```\n\n### Metrics\n\n**Zot**:\n\n```\ncurl http://localhost:5000/metrics\n```\n\n**Harbor**:\n\n```\ncurl http://localhost:9090/metrics\n```\n\n## Related Documentation\n\n- **Architecture**: [OCI Integration](../architecture/multi-repo-strategy.md)\n- **User Guide**: [OCI Registry Guide](../user/oci-registry-guide.md)
