How tech-shrimp/docker_image_pusher works
Main Components
• GitHub Repository: Represents the source code and configuration. Include special nodes for:
• The .github/workflows directory (specifically docker.yaml) which scripts the automation.
• The images.txt file that contains the list of Docker images (input configuration).
• Documentation files (doc folder, images, and README).
• GitHub Actions Workflow Engine: The automation server that executes the docker.yaml. This component triggers on push events (for example, when images.txt is updated) or on a scheduled (cron) basis.
• External Docker Registries:
• Source registries such as DockerHub, gcr.io, k8s.io, and ghcr.io.
• Alibaba Cloud Container Registry: The target private registry where the images are pushed.
• Developer/User Interaction: A node representing how the developer initially forks the repository, configures the environment (secrets like ALIYUN_REGISTRY_USER, ALIYUN_REGISTRY_PASSWORD, etc.), and later monitors execution/output.
Relationships and Interactions
• When an update (e.g., commit to images.txt) or scheduled trigger occurs, the GitHub Actions workflow is launched.
• The workflow reads images.txt and processes the list of images. For each image, it:
• Pulls the image from the respective public registry.
• Authenticates to the Alibaba Cloud Container Registry using the environment secrets.
• Pushes (mirrors) the image to the Alibaba Cloud repository.
• The workflow may also handle parameters like image tag, optional platform settings (via --platform=xxx), or even handle images with duplicate names by adjusting the naming (adding namespace prefixes).
• The overall flow relies on secure interactions maintained via configured repository secrets.
Architectural Patterns and Design Principles
• This tool is a lightweight automation pipeline integrated directly into GitHub. Hence, its architecture isn’t split into multiple long-running services, but it does have a clear separation of concerns:
• Input configuration (images.txt)
• Processing “pipeline” (GitHub Actions which encapsulate the business logic)
• External integrations (source registries and target Alibaba Cloud Container Registry)
• That the design uses declarative workflow definitions (via YAML) and environment configuration (repository secrets) to manage integration and security.
Highlighted Technologies and Frameworks
• GitHub Actions / Workflows (for orchestration)
• Docker (for image pulling and pushing operations)
• Alibaba Cloud Container Registry (as the target service)
• Various public Docker image sources (DockerHub, GCR, etc.)
• (Optionally) Cron scheduling syntax as part of the workflow to trigger periodic tasks.
Specific Elements
• Initiation triggers (commit, schedule) → Start workflow.
• Workflow → Pull images from (DockerHub/gcr.io/…) → then push to “Alibaba Cloud Container Registry.”
• Automation engine (workflow engine) which may be represented as a process block.