为了加速 Docker 和 Github 镜像拉取,你可以使用以下命令设置 registry mirror:
# 配置 Docker 服务
sudo tee /etc/docker/daemon.json <<EOF
{
"registry-mirrors": ["https://{{host}}"]
}
EOF
# 配置完后需要重启 Docker 服务
sudo systemctl restart docker
-----------------------------------------------
# 配置 Github 代理(临时)
git config --global url."https://[mirror].bingoner.cc/https://github.com".insteadOf "https://github.com"
使用该代理从不同的镜像仓库拉取镜像,请参考以下命令:
# docker pull nginx:latest
docker pull docker.{{host}}/library/nginx:latest # 拉取 Docker 官方镜像
# docker pull quay.io/coreos/etcd:latest
docker pull quay.{{host}}/coreos/etcd:latest # 拉取 Quay 镜像
# docker pull gcr.io/google-containers/busybox:latest
docker pull gcr.{{host}}/google-containers/busybox:latest # 拉取 GCR 镜像
# docker pull k8s.gcr.io/pause:latest
docker pull k8s-gcr.{{host}}/pause:latest # 拉取 k8s.gcr.io 镜像
# docker pull registry.k8s.io/pause:latest
docker pull k8s.{{host}}/pause:latest # 拉取 registry.k8s.io 镜像
# docker pull ghcr.io/github/super-linter:latest
docker pull ghcr.{{host}}/github/super-linter:latest # 拉取 GitHub 容器镜像
# docker pull docker.cloudsmith.io/public/repo/image:latest
docker pull cloudsmith.{{host}}/public/repo/image:latest # 拉取 Cloudsmith 镜像
# Github 分支源码合法输入范例:
https://github.com/fhb302/project/archive/master.zip
# Github release源码:
https://github.com/fhb302/project/archive/v0.1.0.tar.gz
# Github release文件:
https://github.com/fhb302/project/releases/download/v0.1.0/example.zip
# Github 分支文件:
https://github.com/fhb302/project/blob/master/filename
为了避免 Worker 用量耗尽,你可以手动 pull 镜像然后 re-tag 之后 push 至本地镜像仓库。