Docker Images Pusher
使用Github Action将国外的Docker镜像转存到阿里云私有仓库,供国内服务器使用,免费易用
- 支持DockerHub, gcr.io, k8s.io, ghcr.io等任意仓库
- 支持最大40GB的大型镜像
- 使用阿里云的官方线路,速度快
视频教程:https://www.bilibili.com/video/BV1Zn4y19743/
作者:技术爬爬虾
B站,抖音,Youtube全网同名,转载请注明作者
使用方式
配置阿里云
登录阿里云容器镜像服务
https://cr.console.aliyun.com/
启用个人实例,创建一个命名空间(ALIYUN_NAME_SPACE)
访问凭证–>获取环境变量
用户名(ALIYUN_REGISTRY_USER)
密码(ALIYUN_REGISTRY_PASSWORD)
仓库地址(ALIYUN_REGISTRY)
Fork本项目
Fork本项目
启动Action
进入您自己的项目,点击Action,启用Github Action功能
配置环境变量
进入Settings->Secret and variables->Actions->New Repository secret
将上一步的四个值
ALIYUN_NAME_SPACE,ALIYUN_REGISTRY_USER,ALIYUN_REGISTRY_PASSWORD,ALIYUN_REGISTRY
配置成环境变量
添加镜像
打开images.txt文件,添加你想要的镜像
可以加tag,也可以不用(默认latest)
可添加 --platform=xxxxx 的参数指定镜像架构
可使用 k8s.gcr.io/kube-state-metrics/kube-state-metrics 格式指定私库
可使用 #开头作为注释
文件提交后,自动进入Github Action构建
使用镜像
回到阿里云,镜像仓库,点击任意镜像,可查看镜像状态。(可以改成公开,拉取镜像免登录)
在国内服务器pull镜像, 例如:
docker pull registry.cn-hangzhou.aliyuncs.com/shrimp-images/alpine
registry.cn-hangzhou.aliyuncs.com 即 ALIYUN_REGISTRY(阿里云仓库地址)
shrimp-images 即 ALIYUN_NAME_SPACE(阿里云命名空间)
alpine 即 阿里云中显示的镜像名
多架构
需要在images.txt中用 --platform=xxxxx手动指定镜像架构
指定后的架构会以前缀的形式放在镜像名字前面
镜像重名
程序自动判断是否存在名称相同, 但是属于不同命名空间的情况。 如果存在,会把命名空间作为前缀加在镜像名称前。 例如:
xhofe/alist
xiaoyaliu/alist
定时执行
修改/.github/workflows/docker.yaml文件
添加 schedule即可定时执行(此处cron使用UTC时区)
Docker Images Pusher
Project Details
- LJD2024/docker_image_pusher
- Apache License 2.0
- Last Updated: 8/1/2024
Recomended MCP Servers
A simple MCP server that fetches real-time financial data from Alpha Vantage API. Get instant access to stock...
Write 10x better prompts using Prompt Engineer MCP server.
An MCP(Model Context Protocol) Server for retrieving and sharing your bash/zsh history with MCP Client (Cursor, Claude etc.)
This is a repository to experiment with MCP for security
A lightweight FastAPI server that can run as a Windows service and exposes an endpoint to execute shell...
headless-ida-mcp-server
Untappd Model Context Protocol Server
Model Context Protocol (MCP) with TikTok integration
A Model Context Protocol server for Linear.
An MCP server that exposes AWS EC2 pricing data with an option to search by CPU, RAM, networking