How renjiangyang/docker_image_pusher works
Project type and purpose
• This is a GitHub-Action-based automation tool (“Docker Images Pusher”) that mirrors any public Docker image (from DockerHub, gcr.io, k8s.io, ghcr.io, etc.) into an Alibaba Cloud Container Registry namespace.
• Its purpose is to let teams in China or behind network filters pull large container images quickly from a private Aliyun mirror, controlled by a simple “images.txt” list and driven entirely by GitHub Actions.
File structure
• Top-level files:
• README.md – explains usage, configuration, secrets.
• images.txt – the only user-editable list of source images (with optional tags and --platform flags).
• .github/workflows/docker.yaml – the CI/CD pipeline definition.
• No code libraries or backends; the “engine” is entirely the GitHub Actions workflow script using Docker CLI commands and buildx.
README for additional insights
• Key sections: configuration of Aliyun namespace, secrets (ALIYUN_NAME_SPACE, ALIYUN_REGISTRY_USER, ALIYUN_REGISTRY_PASSWORD, ALIYUN_REGISTRY), adding images to images.txt, optional scheduling via cron in docker.yaml.
• The workflow supports multi-arch via --platform, handles duplicate names by prefixing with source namespace, and can be triggered on push or on a schedule.
a. Main components
• GitHub Repository (contains images.txt + .github/workflows/docker.yaml)
• GitHub Actions Runner (hosted by GitHub)
• Source Registries (DockerHub, gcr.io, k8s.io, ghcr.io, etc.)
• Aliyun Container Registry (private mirror)
• GitHub Secrets (stores ALIYUN_* environment variables)
b. Relationships and interactions
1. Developer pushes updates to images.txt or modifies the workflow → GitHub
2. GitHub triggers the Action (on push or schedule) → Runner spins up
3. Runner reads secrets from GitHub Secrets
4. Runner reads images.txt line by line → For each image:
• Docker CLI pulls from Source Registry
• (Optional) buildx multi-arch logic
• Docker CLI pushes to Aliyun Registry using the configured namespace and credentials
5. Aliyun Registry stores mirrored images for downstream consumption
c. Architectural patterns and design principles
• “Configuration-as-code”: images.txt drives the list of mirrors.
• “Infrastructure as code” pipeline (GitHub Actions) with secrets injection.
• Stateless, ephemeral build runners – no servers to manage.
• Idempotent design: re-running the workflow only mirrors missing or updated tags.
d. Technologies, frameworks, and libraries
• GitHub Actions (workflow orchestration)
• Docker CLI & Docker buildx (image pull/build/push)
• GitHub Secrets for secure credential storage
• Alibaba Cloud Container Registry (mirror endpoint)
• Optional cron scheduling inside docker.yaml