使用 GitHub Actions 实现镜像复制
-
设置阿里云容器镜像服务
- 注册阿里云账号,例如:
helloworld - 开启容器镜像服务个人免费版实例
- 创建命名空间,例如:
superman - 设置固定密码,例如:
superwoman
- 注册阿里云账号,例如:
-
创建
Github仓库- 点击
Use this template创建仓库 - 在仓库设置中添加
Actions SecretsREGISTRY设置为registry.cn-beijing.aliyuncs.comREGISTRY_USER设置为阿里云账户全名helloworldREGISTRY_PASSWORD设置为阿里云容器镜像服务固定密码superwoman
- 点击
-
自动触发
- 新建或修改
images.txt文件,格式参考images.txt.example,每行一个镜像,格式为source|dest - 提交
images.txt文件,自动触发Actions构建
- 新建或修改
-
手动触发
- 点击
Actions,选择Manual Copy Image,点击Run workflow进行手动触发 - 支持多架构复制,默认关闭
- 点击
# docker pull redis:7.2.5
docker pull registry.cn-beijing.aliyuncs.com/superman/redis:7.2.5
# docker pull quay.io/coreos/etcd:v3.5.17
docker pull registry.cn-beijing.aliyuncs.com/superman/etcd:v3.5.17
# docker pull k8s.gcr.io/pause:3.2
docker pull registry.cn-beijing.aliyuncs.com/superman/pause:3.2
# docker pull k8s.gcr.io/coredns:1.6.6
docker pull registry.cn-beijing.aliyuncs.com/superman/coredns:1.6.6