Skip to content

Repository to release images from Docker Hub and securely republish them within GitHub Packages in an auditable and reliable manner.

Notifications You must be signed in to change notification settings

codaqui/libertyhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

64 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ LibertyHub

Image Request

Repository to release images from Docker Hub and securely republish them within GitHub Packages in an auditable and reliable manner.

🎯 Purpose

LibertyHub is designed to provide a transparent and secure way to import container images from external sources (initially Docker Hub) into GitHub Packages. This enhances security, provides audit trails, and reduces dependency on external registries.

πŸ”„ How It Works

  1. πŸ“‹ Issue-Based Workflow: Users create an issue using a standardized template
  2. πŸ€– Automated Processing: GitHub Workflows process the request with intelligent naming
  3. βœ… Verification & Publishing: The system checks, imports and publishes with proper mapping
  4. πŸ“Š Audit Trail: All actions are logged for complete transparency

✨ Features

  • πŸŽ›οΈ Source Selection: Choose the image source (initially Docker Hub, with plans to expand)
  • πŸ“¦ Support for Official Images: Option to mark an image as an official Docker Hub image
  • πŸ“ Simple Request Process: Easy-to-use issue template with dropdown options
  • πŸ”„ Latest Version Support: Option to select the latest version of an image
  • πŸ”„ Automatic Updates: For images marked as "latest", duplicate requests will trigger an update
  • 🏷️ Intelligent Naming: Smart naming convention with conflict resolution
  • πŸ“‹ Complete Audit Trail: All actions are logged, including image hashes, versions, and workflow details
  • 🚫 Duplicate Prevention: System verifies if the requested image already exists before processing
  • οΏ½ Execution Control: Prevents duplicate workflow runs with smart event handling and state tracking
  • οΏ½πŸ—‚οΈ Image Mapping: Advanced naming system to handle complex Docker Hub structures

🏷️ Naming Convention & Image Mapping

Standard Naming Pattern

Images are republished following the pattern:

  • Official images: ghcr.io/codaqui/dockerhub-<image>:<version>
  • Organization images: ghcr.io/codaqui/dockerhub-<org>-<image>:<version>

Intelligent Image Name Extraction

The system uses intelligent extraction to handle various Docker Hub naming patterns:

πŸ“¦ Official Images

Docker Hub: nginx:latest
GHCR: ghcr.io/codaqui/dockerhub-nginx:latest

🏒 Organization/Repository Images

Docker Hub: bitnami/nginx:latest
GHCR: ghcr.io/codaqui/dockerhub-bitnami-nginx:latest

Docker Hub: homeassistant/core:latest  
GHCR: ghcr.io/codaqui/dockerhub-homeassistant-core:latest

Docker Hub: confluentinc/cp-kafka:latest
GHCR: ghcr.io/codaqui/dockerhub-confluentinc-cp-kafka:latest

πŸ”§ Complex Naming Examples

Docker Hub: homeassistant/aarch64-homeassistant:latest
GHCR: ghcr.io/codaqui/dockerhub-homeassistant-aarch64-homeassistant:latest

Docker Hub: microsoft/mssql-server-linux:latest
GHCR: ghcr.io/codaqui/dockerhub-microsoft-mssql-server-linux:latest

Docker Hub: prom/prometheus:latest
GHCR: ghcr.io/codaqui/dockerhub-prom-prometheus:latest

🚨 Naming Conflict Resolution & Limitations

Organization Names with Hyphens: ❌ Not Supported

The system rejects organization names containing hyphens to avoid conflicts:

❌ REJECTED: docker-compose/nginx β†’ Would create: dockerhub-docker-compose-nginx
❌ REJECTED: my-org/postgres β†’ Would create: dockerhub-my-org-postgres

Why?: These create ambiguity in reverse mapping for automatic updates:

  • dockerhub-my-org-postgres could be interpreted as:
    • my-org/postgres βœ… (intended)
    • my/org-postgres ❌ (wrong interpretation)

Workarounds:

  1. Use organizations without hyphens when possible
  2. Request official image status from Docker Hub
  3. Use alternative image sources (official variants)

πŸ“Š Mapping Information

Each import creates a mapping record:

{
  "source_pattern": "homeassistant/core:latest",
  "target_pattern": "dockerhub-homeassistant-core", 
  "mapping_type": "org_image_combination",
  "original_repo": "homeassistant",
  "original_image": "core",
  "org_name": "homeassistant", 
  "image_name": "core",
  "created": "2025-06-11T20:30:45Z"
}

Mapping Types:

  • standard: Direct mapping (official images)
  • org_image_combination: Organization + image name combination
  • sanitized_fallback: Fallback for complex structures

πŸš€ Usage

πŸ“ Creating an Import Request

  1. Create Issue: Use the "Image Import Request" template
  2. Fill Information:
    • Image source: Select "Docker Hub" from dropdown
    • Official image: Check if it's an official Docker Hub image
    • Repository name:
      • βœ… Leave empty for official images (nginx, ubuntu, postgres)
      • βœ… Required for organization images (bitnami, homeassistant, microsoft)
    • Image name: The actual image name
    • Version: Specific version or check "Use latest"
  3. Submit: The workflow processes automatically
  4. Track Progress: Updates provided in issue comments
  5. Use Image: Available in GitHub Packages with smart naming

πŸ“‹ Request Examples

Official Image

βœ… Source: Docker Hub
βœ… Official: [x] This is an official Docker Hub image  
βœ… Repository: [leave empty]
βœ… Image: nginx
βœ… Version: latest
Result: ghcr.io/codaqui/dockerhub-nginx:latest

Organization Image

βœ… Source: Docker Hub
❌ Official: [ ] This is an official Docker Hub image
βœ… Repository: homeassistant
βœ… Image: core 
βœ… Version: latest
Result: ghcr.io/codaqui/dockerhub-homeassistant-core:latest

Complex Organization Image

βœ… Source: Docker Hub
❌ Official: [ ] This is an official Docker Hub image
βœ… Repository: homeassistant
βœ… Image: aarch64-homeassistant  
βœ… Version: latest
Result: ghcr.io/codaqui/dockerhub-homeassistant-aarch64-homeassistant:latest

Complex Organization

βœ… Source: Docker Hub
❌ Official: [ ] This is an official Docker Hub image
βœ… Repository: microsoft
βœ… Image: mssql-server-linux
βœ… Version: 2019-latest
Result: ghcr.io/codaqui/dockerhub-microsoft-mssql-server-linux:2019-latest

πŸ”„ Updating Latest Images

To update an image tagged as "latest":

  1. Create a new import request with same details
  2. Check "Use latest" option
  3. System detects duplicate and updates automatically
  4. Audit trail shows before/after hashes

⏰ Scheduled Updates

A scheduled workflow automatically updates all latest images daily:

  • πŸ•› Runs: Daily at midnight UTC
  • πŸš€ Manual trigger: Available via workflow_dispatch
  • πŸ“Š Smart updates: Only updates when source image changed
  • πŸ“‹ Full audit: Complete logging and hash verification

πŸ“Š Audit & Transparency

πŸ“‹ Import Audit Information

Each import includes:

  • πŸ” Source verification: Original Docker Hub image details
  • πŸ” Hash tracking: SHA256 hashes before/after import
  • πŸ• Timestamps: Complete temporal tracking
  • πŸ‘€ Attribution: User who requested import
  • πŸ”— Workflow logs: Full GitHub Actions execution logs
  • πŸ—‚οΈ Mapping details: How naming was resolved

πŸ“ˆ Update Audit Information

For updated images:

  • πŸ”„ Previous state: Hash of existing image
  • πŸ†• New state: Hash of updated image
  • πŸ“Š Comparison: What changed between versions
  • ⚑ Update trigger: Manual vs scheduled
  • πŸ” Pull method: How the source was obtained

πŸ—ƒοΈ Audit File Format

{
  "timestamp": "2025-06-11T20:30:45Z",
  "workflow_run": "15594728920", 
  "request": {
    "source": "homeassistant/core:latest",
    "target": "ghcr.io/codaqui/dockerhub-homeassistant-core:latest",
    "status": "success",
    "source_hash": "sha256:abc123...",
    "target_hash": "sha256:abc123...",
    "pull_method": "direct",
    "image_exists": false,
    "update_needed": true,
    "mapping": {
      "source_pattern": "homeassistant/core:latest",
      "target_pattern": "dockerhub-homeassistant-core",
      "mapping_type": "org_image_combination",
      "original_repo": "homeassistant",
      "original_image": "core",
      "org_name": "homeassistant",
      "image_name": "core"
    }
  }
}

πŸ›‘οΈ Security & Best Practices

πŸ” Security Features

  • βœ… Hash verification: Every image verified with SHA256
  • βœ… Audit trails: Complete transparency in all operations
  • βœ… Access control: GitHub permissions and authentication
  • βœ… Isolated builds: Each import in isolated environment

πŸ“‹ Best Practices

  • 🎯 Specific versions: Use specific tags when possible vs latest
  • πŸ”„ Regular updates: Keep latest images updated via scheduled workflow
  • πŸ“Š Monitor logs: Review audit information for any anomalies
  • 🏷️ Consistent naming: Follow the established naming conventions

🀝 Contributing

Contributions to improve LibertyHub are welcome:

  1. πŸ› Bug reports: Use GitHub issues
  2. πŸ’‘ Feature requests: Use GitHub discussions
  3. πŸ”§ Code contributions: Follow our PR guidelines
  4. πŸ“š Documentation: Help improve this README

πŸš€ Development & Credits

Version 2.0.0 - Enhanced automation and improved user experience

This major version was developed with the assistance of Claude Sonnet 4, which significantly contributed to:

  • πŸ”§ Workflow Optimization: Enhanced GitHub Actions workflows with better error handling
  • πŸ“ Documentation Improvements: Comprehensive README updates and clearer user guidance
  • 🎨 Issue Template Enhancement: More intuitive and informative request templates
  • πŸ› Bug Fixes: Resolution of Docker template parsing errors and naming conflicts
  • ✨ Feature Enhancements: Improved audit trails and automatic update mechanisms

Special thanks to Claude Sonnet 4 for the exceptional assistance in making LibertyHub more robust and user-friendly.

πŸ“„ License

LibertyHub is licensed under the MIT License. Version 2.0.0 was developed with significant assistance from Claude Sonnet 4, demonstrating the power of AI-assisted development in creating robust automation solutions.

About

Repository to release images from Docker Hub and securely republish them within GitHub Packages in an auditable and reliable manner.

Resources

Stars

Watchers

Forks

Packages