使用 docker.io 或其他镜像服务来提供(但不限于) gcr.io、k8s.gcr.io、quay.io、ghcr.io 等国外镜像加速下载服务
限制:每次提交最多 11 个镜像地址
个人 Docker 账号有每日镜像拉取限额,请勿滥用
开启 Settings-Options-Features 中的 Issues 功能
-
如果要使用DockerHub的镜像服务
在
Settings-Secrets新建DOCKER_USERNAME(你的 Docker 用户名) 和DOCKER_TOKEN(你的 Docker 密码) 两个 Secrets -
如果需要使用其他镜像服务,例如腾讯云,阿里云
在
Settings-Secrets新建DOCKER_USERNAME(你的其他镜像服务用户名) 和DOCKER_TOKEN(你的其他镜像服务密码)以及DOCKER_REPOSITORY三个 SecretsDOCKER_REPOSITORY配置例子- 腾讯云:
ccr.ccs.tencentyun.com/xxxxxx - 阿里云:
registry.cn-hangzhou.aliyuncs.com/xxxxxx - 其他云...
- 腾讯云:
在 Issues-Labels 添加三个 label :hub-mirror、success、failure
最后在 Actions 里选择 hub-mirror ,在右边 ··· 菜单里选择 Enable Workflow
$ go install github.com/togettoyou/hub-mirror@latest$ hub-mirror --username=xxxxxx --password=xxxxxx --content='{ "hub-mirror": ["gcr.io/google-samples/microservices-demo/emailservice:v0.3.5","hello-world:latest"] }'
# 如果需要使用自定义镜像仓库
$ hub-mirror --username=xxxxxx --password=xxxxxx --repository=registry.cn-hangzhou.aliyuncs.com/xxxxxx --content='{ "hub-mirror": ["gcr.io/google-samples/microservices-demo/emailservice:v0.3.5","hello-world:latest"] }'