Docker / Kubernetes 镜像源

Azure 中国镜像源地址:http://mirror.azure.cn/
Azure 中国镜像源 Github 地址:https://github.com/Azure/container-service-for-azure-china
镜像源配置说明:http://mirror.azure.cn/help/gcr-proxy-cache.html
中科大镜像源地址:http://mirrors.ustc.edu.cn/
中科大镜像源 Github 地址:https://github.com/ustclug/mirrorrequest
镜像源配置说明:https://github.com/ustclug/mirrorrequest/issues/187
使用镜像源加速 Docker.io 镜像仓库
如果在 Docker 官方仓库拉取的是官方镜像,拉取方法类似如下:
$ docker pull xxx:yyy
使用中科大镜像源,应该类似这样拉取:
$ docker pull docker.mirrors.ustc.edu.cn/library/xxx:yyy
使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull dockerhub.azk8s.cn/library/xxx:yyy
如果在 Docker 官方仓库拉取的镜像是私有仓库
拉取方法类似如下:
$ docker pull xxx/yyy:zz
使用中科大镜像源,应该类似这样拉取:
$ docker pull docker.mirrors.ustc.edu.cn/xxx/yyy:zz
使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull dockerhub.azk8s.cn/xxx/yyy:zz
- 演示一个使用镜像源拉取的实例
# 使用中科大镜像源 $ docker pull docker.mirrors.ustc.edu.cn/library/mysql:5.7
$ docker pull docker.mirrors.ustc.edu.cn/360cloud/wayne
# 使用 Azure 中国镜像源 $ docker pull dockerhub.azk8s.cn/library/mysql:5.7
$ docker pull dockerhub.azk8s.cn/360cloud/wayne
注:首次拉取时可能会有 Error:image library/mysql:5.7 not found 类似报错,这说明镜像源中没有缓存该镜像。这个属于正常现像,因为加速镜像都是先从官方镜像仓库进行拉取的,然后缓存到本地。遇到这种情况,你可以尝试多拉取几次即可。
使用镜像源加速 gcr.io 镜像仓库
- 如果拉取的 Google 镜像仓库中容器镜像类似如下:
$ docker pull gcr.io/xxx/yyy:zzz 使用中科大镜像源,应该类似这样拉取:
$ docker pull gcr.mirrors.ustc.edu.cn/xxx/yyy:zzz 使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull gcr.azk8s.cn/xxx/yyy:zzz
- 演示一个使用镜像源拉取的实例
下面我们以拉取 gcr.io/kubernetes-helm/tiller:v2.9.1 为例: # 使用中科大镜像源
$ docker pull gcr.mirrors.ustc.edu.cn/kubernetes-helm/tiller:v2.9.1 # 使用 Azure 中国镜像源
$ docker pull gcr.azk8s.cn/kubernetes-helm/tiller:v2.9.1
使用镜像源加速 k8s.gcr.io 镜像仓库
- 如果我们拉取的 Kubernetes 所需容器镜像类似以下形式:
$ docker pull k8s.gcr.io/xxx:yyy
# 相当于$ docker pull gcr.io/google-containers/xxx:yyy 使用中科大镜像源,应该类似这样拉取:
$ docker pull gcr.mirrors.ustc.edu.cn/google-containers/xxx:yyy 使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull gcr.azk8s.cn/google-containers/xxx:yyy
- 演示一个使用镜像源拉取的实例
# 使用中科大镜像源
$ docker pull gcr.mirrors.ustc.edu.cn/google-containers/addon-resizer:1.8.
# 使用 Azure 中国镜像源
$ docker pull gcr.azk8s.cn/google-containers/addon-resizer:1.8.
使用镜像源加速 quay.io 镜像仓库
- 如果我们拉取的 quay.io 下所需容器镜像类似以下形式:
$ docker pull quay.io/xxx/yyy:zzz 使用中科大镜像源,应该类似这样拉取:
$ docker pull quay.mirrors.ustc.edu.cn/xxx/yyy:zzz 使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull quay.azk8s.cn/xxx/yyy:zzz
- 演示一个使用镜像源拉取的实例
# 使用中科大镜像源
$ docker pull quay.mirrors.ustc.edu.cn/coreos/kube-state-metrics:v1.5.0
# 使用 Azure 中国镜像源
$ docker pull quay.azk8s.cn/coreos/kube-state-metrics:v1.5.0
一些自动化工具
docker-wrapper
docker-wrapper 安装
$ git clone https://github.com/silenceshell/docker-wrapper.git
$ sudo cp docker-wrapper/docker-wrapper.py /usr/local/bin/ docker-wrapper 使用
$ docker-wrapper pull k8s.gcr.io/kube-apiserver:v1.14.1
$ docker-wrapper pull gcr.io/google_containers/kube-apiserver:v1.14.1
$ docker-wrapper pull nginx
$ docker-wrapper pull silenceshell/godaddy:0.0.
azk8spull
azk8spull 安装
$ git clone https://github.com/xuxinkun/littleTools$ cd littleTools
$ chmod +x install.sh
$ ./install.sh azk8spull 使用
$ azk8spull quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.24.
$ azk8spull k8s.gcr.io/pause-amd64:3.1
参考文档
- https://www.google.com
- https://ieevee.com/tech/2019/03/02/azure-gcr-proxy.html
- https://www.cnblogs.com/xuxinkun/p/11025020.html
- https://www.ilanni.com/?p=14534
Docker / Kubernetes 镜像源的更多相关文章
- docker 国内镜像源
参考:docker 国内镜像源 作者:Joncc Linux环境 # vi /etc/docker/daemon.json { "registry-mirrors": [" ...
- docker改变镜像源
sudo echo “DOCKER_OPTS=\”\$DOCKER_OPTS –registry-mirror=http://your-id.m.daocloud.io -d\”” >> ...
- Docker国内镜像源设置
编辑json文件,添加如下内容后重启docker即可. [root@Docker ~]# cat /etc/docker/daemon.json{ "registry-mirrors&quo ...
- Docker CE 镜像源站
sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl software-proper ...
- docker国内镜像源
https://www.daocloud.io/mirror curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http ...
- 替换 Docker 或 Laradock 中 Debian 系统镜像源解决软件安装问题
Docker Debian 镜像源替换 因多数默认的 Docker 镜像为国外的,而采用的镜像源也是国外的,故访问很慢,所以我们需要替换为国内的(比如阿里云或163等). 163 - Debian A ...
- docker镜像源设置
由于docker默认镜像源为国外官方源,下载速度较慢.设置国内镜像源可加速 修改文件 /etc/docker/daemon.json vi /etc/docker/daemon.json 添加以下内容 ...
- docker配置国内阿里云镜像源
使用docker默认镜像源下载镜像会很慢,因此很多情况下,我们在安装完docker以后都会修改为国内的镜像,这样在下载镜像的时候就不用等那么长时间了. 配置docker的镜像为阿里云镜像 方法一 $ ...
- Docker之镜像地址
转载自https://www.cnblogs.com/doraman/p/9570891.html 官方docker hub 官方:https://hub.docker.com/explore/ 常用 ...
随机推荐
- .Net Framework为什么需要联网?
.Net Framework在安装时需要从微软官方网站下载语言包,所以需要联网. 如果想要真正离线安装,需要先把所需的语言包下载下来.
- 主席树 - 查询某区间第 K 大
You are working for Macrohard company in data structures department. After failing your previous tas ...
- String.valueOf(null)
public static String valueOf(Object obj) { return (obj == null) ? "null" : obj.toString(); ...
- Webpack实战(五):轻松读懂Webpack如何分离样式文件
在上一篇文章中我给大家分享了预处理器(loader),里面讲到了style-loader 和css-loader,有关样式引入的问题,但是上面的样式文件只是引入到style标签里面,并不是我想要的样式 ...
- ASP .Net Core MVC如何利用vue提交包含List属性的form表单
前言 遇到这个问题,是由于自己在mvc项目中使用vue而并不想jquery(人嘛,就是要折腾),并且表单中的一个属性是一个集合. 研究了下Razor如何实现的,用jquery感觉就挺麻烦了,vue用在 ...
- css 透明度
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8& ...
- 【新书推荐】《ASP.NET Core微服务实战:在云环境中开发、测试和部署跨平台服务》 带你走近微服务开发
<ASP.NET Core 微服务实战>译者序:https://blog.jijiechen.com/post/aspnetcore-microservices-preface-by-tr ...
- PHP——数组
数组的定义 数组能够在单个变量中存储多个值. 创建空数组: $arr = array();//表示创建一个空数组,并把创建的空数组赋值给变量$arr 数值数组 自动分配 ID 键(ID 键总是从 0 ...
- 个人第四次作业Alpha2版本测试~顾毓
个人第四次作业Alpha2版本测试 这个作业属于哪个课程 https://edu.cnblogs.com/campus/xnsy/GeographicInformationScience/ 这个作业要 ...
- 清晰架构(Clean Architecture)的Go微服务: 编码风格
编码风格在编程中是一个相对乏味的主题,但是合适的编码风格对一个有效的程序员是至关重要的. 它有三个组成部分: 程序结构 ( application layout) 编码规则或风格 命名约定 我已经在清 ...