{"id":13488046,"url":"https://github.com/tech-shrimp/docker_image_pusher","last_synced_at":"2025-05-13T22:07:28.505Z","repository":{"id":243398537,"uuid":"812323913","full_name":"tech-shrimp/docker_image_pusher","owner":"tech-shrimp","description":"使用Github Action将国外的Docker镜像转存到阿里云私有仓库，供国内服务器使用，免费易用","archived":false,"fork":false,"pushed_at":"2024-08-21T06:57:35.000Z","size":734,"stargazers_count":2368,"open_issues_count":189,"forks_count":13681,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-30T15:18:10.317Z","etag":null,"topics":["aliyun","docker","docker-image","dockerhub","github-actions"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tech-shrimp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-08T15:09:41.000Z","updated_at":"2025-04-30T14:56:50.000Z","dependencies_parsed_at":"2024-09-19T01:04:26.732Z","dependency_job_id":null,"html_url":"https://github.com/tech-shrimp/docker_image_pusher","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.30000000000000004","last_synced_commit":"8d564bebc5dbce96d6d166af2f40a09bc66eb770"},"previous_names":["tech-shrimp/docker_image_pusher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-shrimp%2Fdocker_image_pusher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-shrimp%2Fdocker_image_pusher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-shrimp%2Fdocker_image_pusher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-shrimp%2Fdocker_image_pusher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tech-shrimp","download_url":"https://codeload.github.com/tech-shrimp/docker_image_pusher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036821,"owners_count":22003654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliyun","docker","docker-image","dockerhub","github-actions"],"created_at":"2024-07-31T18:01:08.643Z","updated_at":"2025-05-13T22:07:23.486Z","avatar_url":"https://github.com/tech-shrimp.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Docker Images Pusher\n\n使用Github Action将国外的Docker镜像转存到阿里云私有仓库，供国内服务器使用，免费易用\u003cbr\u003e\n- 支持DockerHub, gcr.io, k8s.io, ghcr.io等任意仓库\u003cbr\u003e\n- 支持最大40GB的大型镜像\u003cbr\u003e\n- 使用阿里云的官方线路，速度快\u003cbr\u003e\n\n视频教程：https://www.bilibili.com/video/BV1Zn4y19743/\n\n作者：**[技术爬爬虾](https://github.com/tech-shrimp/me)**\u003cbr\u003e\nB站，抖音，Youtube全网同名，转载请注明作者\u003cbr\u003e\n\n## 使用方式\n\n\n### 配置阿里云\n登录阿里云容器镜像服务\u003cbr\u003e\nhttps://cr.console.aliyun.com/\u003cbr\u003e\n启用个人实例，创建一个命名空间（**ALIYUN_NAME_SPACE**）\n![](/doc/命名空间.png)\n\n访问凭证–\u003e获取环境变量\u003cbr\u003e\n用户名（**ALIYUN_REGISTRY_USER**)\u003cbr\u003e\n密码（**ALIYUN_REGISTRY_PASSWORD**)\u003cbr\u003e\n仓库地址（**ALIYUN_REGISTRY**）\u003cbr\u003e\n\n![](/doc/用户名密码.png)\n\n\n### Fork本项目\nFork本项目\u003cbr\u003e\n#### 启动Action\n进入您自己的项目，点击Action，启用Github Action功能\u003cbr\u003e\n#### 配置环境变量\n进入Settings-\u003eSecret and variables-\u003eActions-\u003eNew Repository secret\n![](doc/配置环境变量.png)\n将上一步的**四个值**\u003cbr\u003e\nALIYUN_NAME_SPACE,ALIYUN_REGISTRY_USER，ALIYUN_REGISTRY_PASSWORD，ALIYUN_REGISTRY\u003cbr\u003e\n配置成环境变量\n\n### 添加镜像\n打开images.txt文件，添加你想要的镜像 \n可以加tag，也可以不用(默认latest)\u003cbr\u003e\n可添加 --platform=xxxxx 的参数指定镜像架构\u003cbr\u003e\n可使用 k8s.gcr.io/kube-state-metrics/kube-state-metrics 格式指定私库\u003cbr\u003e\n可使用 #开头作为注释\u003cbr\u003e\n![](doc/images.png)\n文件提交后，自动进入Github Action构建\n\n### 使用镜像\n回到阿里云，镜像仓库，点击任意镜像，可查看镜像状态。(可以改成公开，拉取镜像免登录)\n![](doc/开始使用.png)\n\n在国内服务器pull镜像, 例如：\u003cbr\u003e\n```\ndocker pull registry.cn-hangzhou.aliyuncs.com/shrimp-images/alpine\n```\nregistry.cn-hangzhou.aliyuncs.com 即 ALIYUN_REGISTRY(阿里云仓库地址)\u003cbr\u003e\nshrimp-images 即 ALIYUN_NAME_SPACE(阿里云命名空间)\u003cbr\u003e\nalpine 即 阿里云中显示的镜像名\u003cbr\u003e\n\n### 多架构\n需要在images.txt中用 --platform=xxxxx手动指定镜像架构\n指定后的架构会以前缀的形式放在镜像名字前面\n![](doc/多架构.png)\n\n### 镜像重名\n程序自动判断是否存在名称相同, 但是属于不同命名空间的情况。\n如果存在，会把命名空间作为前缀加在镜像名称前。\n例如:\n```\nxhofe/alist\nxiaoyaliu/alist\n```\n![](doc/镜像重名.png)\n\n### 定时执行\n修改/.github/workflows/docker.yaml文件\n添加 schedule即可定时执行(此处cron使用UTC时区)\n![](doc/定时执行.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftech-shrimp%2Fdocker_image_pusher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftech-shrimp%2Fdocker_image_pusher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftech-shrimp%2Fdocker_image_pusher/lists"}